Files
lc_frontend/build/js/gddt_main.js

803 lines
56 KiB
JavaScript
Raw Normal View History

2025-10-17 10:31:13 +08:00
(function(window){
window.AMapUI_DEBUG = false;
!function(global) {
if (!global.AMap) throw new Error("请前置引入高德地图 JSAPI 参见https://lbs.amap.com/api/jsapi-v2/guide/amap-ui/intro");
}(window);
var AMapUI;!function(){if(!AMapUI||!AMapUI.requirejs){AMapUI?require=AMapUI:AMapUI={};var requirejs,require,define;!function(global,setTimeout){function commentReplace(e,t){return t||""}function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){if(e){var r;for(r=0;r<e.length&&(!e[r]||!t(e[r],r,e));r+=1);}}function eachReverse(e,t){if(e){var r;for(r=e.length-1;r>-1&&(!e[r]||!t(e[r],r,e));r-=1);}}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){var r;for(r in e)if(hasProp(e,r)&&t(e[r],r))break}function mixin(e,t,r,n){return t&&eachProp(t,function(t,i){!r&&hasProp(e,i)||(!n||"object"!=typeof t||!t||isArray(t)||isFunction(t)||t instanceof RegExp?e[i]=t:(e[i]||(e[i]={}),mixin(e[i],t,r,n)))}),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(e){throw e}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),function(e){t=t[e]}),t}function makeError(e,t,r,n){var i=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return i.requireType=e,i.requireModules=n,r&&(i.originalError=r),i}function newContext(e){function t(e){var t,r;for(t=0;t<e.length;t++)if(r=e[t],"."===r)e.splice(t,1),t-=1;else if(".."===r){if(0===t||1===t&&".."===e[2]||".."===e[t-1])continue;t>0&&(e.splice(t-1,2),t-=2)}}function r(e,r,n){var i,o,a,s,u,c,f,p,d,l,h,m,g=r&&r.split("/"),v=w.map,x=v&&v["*"];if(e&&(e=e.split("/"),f=e.length-1,w.nodeIdCompat&&jsSuffixRegExp.test(e[f])&&(e[f]=e[f].replace(jsSuffixRegExp,"")),"."===e[0].charAt(0)&&g&&(m=g.slice(0,g.length-1),e=m.concat(e)),t(e),e=e.join("/")),n&&v&&(g||x)){a=e.split("/");e:for(s=a.length;s>0;s-=1){if(c=a.slice(0,s).join("/"),g)for(u=g.length;u>0;u-=1)if(o=getOwn(v,g.slice(0,u).join("/")),o&&(o=getOwn(o,c))){p=o,d=s;break e}!l&&x&&getOwn(x,c)&&(l=getOwn(x,c),h=s)}!p&&l&&(p=l,d=h),p&&(a.splice(0,d,p),e=a.join("/"))}return i=getOwn(w.pkgs,e),i?i:e}function n(e){isBrowser&&each(scripts(),function(t){if(t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===q.contextName)return t.parentNode.removeChild(t),!0})}function i(e){var t=getOwn(w.paths,e);if(t&&isArray(t)&&t.length>1)return t.shift(),q.require.undef(e),q.makeRequire(null,{skipMap:!0})([e]),!0}function o(e){var t,r=e?e.indexOf("!"):-1;return r>-1&&(t=e.substring(0,r),e=e.substring(r+1,e.length)),[t,e]}function a(e,t,n,i){var a,s,u,c,f=null,p=t?t.name:null,d=e,l=!0,h="";return e||(l=!1,e="_@r"+(C+=1)),c=o(e),f=c[0],e=c[1],f&&(f=r(f,p,i),s=getOwn(k,f)),e&&(f?h=s&&s.normalize?s.normalize(e,function(e){return r(e,p,i)}):e.indexOf("!")===-1?r(e,p,i):e:(h=r(e,p,i),c=o(h),f=c[0],h=c[1],n=!0,a=q.nameToUrl(h))),u=!f||s||n?"":"_unnormalized"+(T+=1),{prefix:f,name:h,parentMap:t,unnormalized:!!u,url:a,originalName:d,isDefine:l,id:(f?f+"!"+h:h)+u}}function s(e){var t=e.id,r=getOwn(M,t);return r||(r=M[t]=new q.Module(e)),r}function u(e,t,r){var n=e.id,i=getOwn(M,n);!hasProp(k,n)||i&&!i.defineEmitComplete?(i=s(e),i.error&&"error"===t?r(i.error):i.on(t,r)):"defined"===t&&r(k[n])}function c(e,t){var r=e.requireModules,n=!1;t?t(e):(each(r,function(t){var r=getOwn(M,t);r&&(r.error=e,r.events.error&&(n=!0,r.emit("error",e)))}),n||req.onError(e))}function f(){globalDefQueue.length&&(each(globalDefQueue,function(e){var t=e[0];"string"==typeof t&&(q.defQueueMap[t]=!0),O.push(e)}),globalDefQueue=[])}function p(e){delete M[e],delete S[e]}function d(e,t,r){var n=e.map.id;e.error?e.emit("error",e.error):(t[n]=!0,each(e.depMaps,function(n,i){var o=n.id,a=getOwn(M,o);!a||e.depMatched[i]||r[o]||(getOwn(t,o)?(e.defineDep(i,k[o]),e.check()):d(a,t,r))}),r[n]=!0)}function l(){var e,t,r=1e3*w.waitSeconds,o=r&&q.startTime+r<(new Date).getTime(),a=[],s=[],u=!1,f=!0;if(!x){if(x=!0,eachProp(S,function(e){var r=e.map,c=r.id;if(e.enabled&&(r.isDefine||s.push(e),!e.error))if(!e.inited&&o)i(c)?(t=!0,u=!0):(a.push(c),n(c));else if(!e.inited&&e.fetched&&r.isDefine&&(u=!0,!r.prefix))return
AMapUI.define("lib/utils", [], function() {
function setLogger(logger) {
logger.debug || (logger.debug = logger.info);
utils.logger = utils.log = logger;
}
var utils, defaultLogger = console, emptyfunc = function() {}, slientLogger = {
log: emptyfunc,
error: emptyfunc,
warn: emptyfunc,
info: emptyfunc,
debug: emptyfunc,
trace: emptyfunc
};
utils = {
slientLogger: slientLogger,
setLogger: setLogger,
mergeArray: function(target, source) {
if (source.length < 5e4) target.push.apply(target, source); else for (var i = 0, len = source.length; i < len; i += 1) target.push(source[i]);
},
setDebugMode: function(on) {
setLogger(on ? defaultLogger : slientLogger);
},
now: Date.now || function() {
return new Date().getTime();
},
bind: function(fn, thisArg) {
return fn.bind ? fn.bind(thisArg) : function() {
return fn.apply(thisArg, arguments);
};
},
domReady: function(callback) {
/complete|loaded|interactive/.test(document.readyState) ? callback() : document.addEventListener("DOMContentLoaded", function() {
callback();
}, !1);
},
forEach: function(array, callback, thisArg) {
if (array.forEach) return array.forEach(callback, thisArg);
for (var i = 0, len = array.length; i < len; i++) callback.call(thisArg, array[i], i);
},
keys: function(obj) {
if (Object.keys) return Object.keys(obj);
var keys = [];
for (var k in obj) obj.hasOwnProperty(k) && keys.push(k);
return keys;
},
map: function(array, callback, thisArg) {
if (array.map) return array.map(callback, thisArg);
for (var newArr = [], i = 0, len = array.length; i < len; i++) newArr[i] = callback.call(thisArg, array[i], i);
return newArr;
},
merge: function(array1, array2) {
if (array2.length < 5e4) Array.prototype.push.apply(array1, array2); else for (var ii = 0, iilen = array2.length; ii < iilen; ii += 1) array1.push(array2[ii]);
},
arrayIndexOf: function(array, searchElement, fromIndex) {
if (array.indexOf) return array.indexOf(searchElement, fromIndex);
var k, o = array, len = o.length >>> 0;
if (0 === len) return -1;
var n = 0 | fromIndex;
if (n >= len) return -1;
k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);
for (;k < len; ) {
if (k in o && o[k] === searchElement) return k;
k++;
}
return -1;
},
extend: function(dst) {
dst || (dst = {});
return utils.extendObjs(dst, Array.prototype.slice.call(arguments, 1));
},
nestExtendObjs: function(dst, objs) {
dst || (dst = {});
for (var i = 0, len = objs.length; i < len; i++) {
var source = objs[i];
if (source) for (var prop in source) source.hasOwnProperty(prop) && (utils.isObject(dst[prop]) && utils.isObject(source[prop]) ? dst[prop] = utils.nestExtendObjs({}, [ dst[prop], source[prop] ]) : dst[prop] = source[prop]);
}
return dst;
},
extendObjs: function(dst, objs) {
dst || (dst = {});
for (var i = 0, len = objs.length; i < len; i++) {
var source = objs[i];
if (source) for (var prop in source) source.hasOwnProperty(prop) && (dst[prop] = source[prop]);
}
return dst;
},
subset: function(props) {
var sobj = {};
if (!props || !props.length) return sobj;
this.isArray(props) || (props = [ props ]);
utils.forEach(Array.prototype.slice.call(arguments, 1), function(source) {
if (source) for (var i = 0, len = props.length; i < len; i++) source.hasOwnProperty(props[i]) && (sobj[props[i]] = source[props[i]]);
});
return sobj;
},
isArray: function(obj) {
return Array.isArray ? Array.isArray(obj) : "[object Array]" === Object.prototype.toString.call(obj);
},
isObject: function(obj) {
return "[object Object]" === Object.prototype.toString.call(obj);
},
isFunction: function(obj) {
return "[object Function]" === Object.prototype.toString.call(obj);
},
isNumber: function(obj) {
return "[object Number]" === Object.prototype.toString.call(obj);
},
isString: function(obj) {
return "[object String]" === Object.prototype.toString.call(obj);
},
isHTMLElement: function(n) {
return window["HTMLElement"] || window["Element"] ? n instanceof (window["HTMLElement"] || window["Element"]) : n && "object" == typeof n && 1 === n.nodeType && "string" == typeof n.nodeName;
},
isSVGElement: function(n) {
return window["SVGElement"] && n instanceof window["SVGElement"];
},
isDefined: function(v) {
return "undefined" != typeof v;
},
random: function(length) {
var str = "", chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz", clen = chars.length;
length || (length = 6);
for (var i = 0; i < length; i++) str += chars.charAt(this.randomInt(0, clen - 1));
return str;
},
randomInt: function(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
},
inherit: function(child, parent) {
function Ctor() {
this.constructor = child;
}
for (var key in parent) parent.hasOwnProperty(key) && (child[key] = parent[key]);
Ctor.prototype = parent.prototype;
child.prototype = new Ctor();
child.__super__ = parent.prototype;
return child;
},
trim: function(s) {
return s ? s.trim ? s.trim() : s.replace(/^\s+|\s+$/gm, "") : "";
},
trigger: function(el, evt, detail) {
if (el) {
detail = detail || {};
var e, opt = {
bubbles: !0,
cancelable: !0,
detail: detail
};
if ("undefined" != typeof CustomEvent) {
e = new CustomEvent(evt, opt);
el.dispatchEvent(e);
} else try {
e = document.createEvent("CustomEvent");
e.initCustomEvent(evt, !0, !0, detail);
el.dispatchEvent(e);
} catch (exp) {
this.log.error(exp);
}
return !0;
}
this.log.error("emply element passed in");
},
nextTick: function(f) {
("object" == typeof process && process.nextTick ? process.nextTick : function(task) {
setTimeout(task, 0);
})(f);
},
removeFromArray: function(arr, val) {
var index = arr.indexOf(val);
index > -1 && arr.splice(index, 1);
return index;
},
debounce: function(func, wait, immediate) {
var timeout, args, context, timestamp, result, later = function() {
var last = utils.now() - timestamp;
if (last < wait && last >= 0) timeout = setTimeout(later, wait - last); else {
timeout = null;
if (!immediate) {
result = func.apply(context, args);
timeout || (context = args = null);
}
}
};
return function() {
context = this;
args = arguments;
timestamp = utils.now();
var callNow = immediate && !timeout;
timeout || (timeout = setTimeout(later, wait));
if (callNow) {
result = func.apply(context, args);
context = args = null;
}
return result;
};
},
throttle: function(func, wait, options) {
var context, args, result, timeout = null, previous = 0;
options || (options = {});
var later = function() {
previous = options.leading === !1 ? 0 : utils.now();
timeout = null;
result = func.apply(context, args);
timeout || (context = args = null);
};
return function() {
var now = utils.now();
previous || options.leading !== !1 || (previous = now);
var remaining = wait - (now - previous);
context = this;
args = arguments;
if (remaining <= 0 || remaining > wait) {
if (timeout) {
clearTimeout(timeout);
timeout = null;
}
previous = now;
result = func.apply(context, args);
timeout || (context = args = null);
} else timeout || options.trailing === !1 || (timeout = setTimeout(later, remaining));
return result;
};
},
ucfirst: function(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
},
escapeHtml: function(text) {
var map = {
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
'"': "&quot;",
"'": "&#x27;",
"`": "&#x60;"
};
return (text + "").replace(/[&<>"']/g, function(m) {
return map[m];
});
}
};
utils.setDebugMode(!1);
return utils;
});
AMapUI.define("lib/detect-global", [ "./utils" ], function(utils) {
var global = this;
return {
load: function(name, req, onLoad, config) {
for (var parts = name.split("|"), gVars = parts[0].split(","), finalMod = parts[1], i = 0, len = gVars.length; i < len; i++) {
var vname = utils.trim(gVars[i]);
if (global[vname]) {
onLoad(global[vname]);
return;
}
}
if (!finalMod) throw new Error("can't find: " + name);
req([ finalMod ], function(value) {
onLoad(value);
});
}
};
});
AMapUI.define("lib/$", [ "lib/detect-global!jQuery,Zepto|" + (AMap.UA.mobile ? "zepto" : "jquery") ], function($) {
return $;
});
AMapUI.define("lib/conf", [ "module" ], function(mod) {
return mod.config();
});
AMapUI.define("lib/dom.utils", [], function() {
var domUtils = {
isCanvasSupported: function() {
var elem = document.createElement("canvas");
return !!(elem && elem.getContext && elem.getContext("2d"));
},
toggleClass: function(el, name, add) {
add ? domUtils.addClass(el, name) : domUtils.removeClass(el, name);
},
addClass: function(el, name) {
el && name && (domUtils.hasClassName(el, name) || (el.className += (el.className ? " " : "") + name));
},
removeClass: function(el, name) {
function replaceFn(w, match) {
return match === name ? "" : w;
}
el && name && (el.className = el.className.replace(/(\S+)\s*/g, replaceFn).replace(/(^\s+|\s+$)/, ""));
},
hasClassName: function(ele, className) {
var testClass = new RegExp("(^|\\s)" + className + "(\\s|$)");
return testClass.test(ele.className);
},
getElementsByClassName: function(className, tag, parent) {
tag = tag || "*";
parent = parent || document;
if (parent.getElementsByClassName) return parent.getElementsByClassName(className);
for (var current, elements = parent.getElementsByTagName(tag), returnElements = [], i = 0; i < elements.length; i++) {
current = elements[i];
domUtils.hasClassName(current, className) && returnElements.push(current);
}
return returnElements;
}
};
return domUtils;
});
AMapUI.define("lib/event", [ "lib/utils" ], function(utils) {
"use strict";
function Event() {
this.__evHash = {};
}
utils.extend(Event.prototype, {
on: function(ev, listener, priority) {
if (this.__multiCall(ev, listener, this.on)) return this;
if (!ev) return this;
var evHash = this.__evHash;
evHash[ev] || (evHash[ev] = []);
var list = evHash[ev], index = this.__index(list, listener);
if (index < 0) {
"number" != typeof priority && (priority = 10);
for (var inps = list.length, i = 0, len = list.length; i < len; i++) if (priority > list[i].priority) {
inps = i;
break;
}
list.splice(inps, 0, {
listener: listener,
priority: priority
});
}
return this;
},
once: function(ev, listener, priority) {
function oncefunc() {
self.__callListenser(listener, arguments);
self.off(ev, oncefunc);
}
if (this.__multiCall(ev, listener, this.once)) return this;
var self = this;
this.on(ev, oncefunc, priority);
return this;
},
offAll: function() {
for (var ev in this.__evHash) this.off(ev);
this.__evHash = {};
return this;
},
off: function(ev, listener) {
if (this.__multiCall(ev, listener, this.off)) return this;
var evHash = this.__evHash;
if (evHash[ev]) {
var list = evHash[ev];
if ("undefined" == typeof listener) {
var c = list.length;
list.length = 0;
return c;
}
var index = this.__index(list, listener);
if (index >= 0) {
list.splice(index, 1);
return 1;
}
return 0;
}
},
listenerLength: function(ev) {
var evHash = this.__evHash, list = evHash[ev];
return list ? list.length : 0;
},
emit: function(ev) {
var args, list, evHash = this.__evHash, count = 0;
list = evHash[ev];
if (list && list.length) {
args = Array.prototype.slice.call(arguments, 1);
count += this.__callListenerList(list, args);
}
list = evHash["*"];
if (list && list.length) {
args = Array.prototype.slice.call(arguments);
count += this.__callListenerList(list, args);
}
return count;
},
trigger: function(ev) {
var args = Array.prototype.slice.call(arguments, 0);
args.splice(1, 0, {
type: ev,
target: this
});
this.emit.apply(this, args);
},
triggerWithOriginalEvent: function(ev, originalEvent) {
var args = Array.prototype.slice.call(arguments, 0);
args[1] = {
type: ev,
target: originalEvent ? originalEvent.target : this,
originalEvent: originalEvent
};
this.emit.apply(this, args);
},
onDestroy: function(cb, priority) {
this.on("__destroy", cb, priority);
return this;
},
destroy: function() {
if (!this.__destroying) {
this.__destroying = 1;
this.emit("__destroy", this);
this.offAll();
return this;
}
},
__multiCall: function(ev, listener, func) {
if (!ev) return !0;
if (utils.isObject(ev) && "undefined" == typeof listener) {
for (var k in ev) func.call(this, k, ev[k]);
return !0;
}
var evs;
utils.isArray(ev) ? evs = ev : "string" == typeof ev && (evs = ev.split(/[\s,]+/));
if (evs && evs.length > 1) {
for (var i = 0, len = evs.length; i < len; i++) evs[i] && func.call(this, evs[i], listener);
return !0;
}
return !1;
},
__index: function(list, listener) {
for (var index = -1, i = 0, len = list.length; i < len; i++) {
var ele = list[i];
if (ele.listener === listener) {
index = i;
break;
}
}
return index;
},
__callListenser: function(listener, args) {
var func = null, contxt = null;
if ("function" == typeof listener) {
func = listener;
contxt = this;
} else if (2 == listener.length) {
func = listener[1];
contxt = listener[0];
}
return func ? [ 1, func.apply(contxt, args) ] : [ 0, void 0 ];
},
__callListenerList: function(list, args) {
if (!list || !list.length) return 0;
list = [].concat(list);
for (var cres, count = 0, i = 0, len = list.length; i < len; i++) {
cres = this.__callListenser(list[i].listener, args);
count += cres[0];
if (cres[1] === !1) break;
}
return count;
}
});
return Event;
});
AMapUI.define("lib/underscore-tpl", [], function() {
function escapeHtml(text) {
var map = {
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
'"': "&quot;",
"'": "&#x27;",
"`": "&#x60;"
};
return (text + "").replace(/[&<>"']/g, function(m) {
return map[m];
});
}
function tmpl(text, data) {
var settings = templateSettings, matcher = new RegExp([ (settings.escape || noMatch).source, (settings.interpolate || noMatch).source, (settings.evaluate || noMatch).source ].join("|") + "|$", "g"), index = 0, source = "__p+='";
text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
source += text.slice(index, offset).replace(escapeRegExp, escapeChar);
index = offset + match.length;
escape ? source += "'+\n((__t=(" + escape + "))==null?'':" + innerContextVarName + ".escape(__t))+\n'" : interpolate ? source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'" : evaluate && (source += "';\n" + evaluate + "\n__p+='");
return match;
});
source += "';\n";
settings.variable || (source = "with(obj||{}){\n" + source + "}\n");
source = "var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n" + source + "return __p;\n";
var render;
try {
render = new Function(settings.variable || "obj", innerContextVarName, source);
} catch (e) {
e.source = source;
throw e;
}
var template = function(data) {
return render.call(this, data, {
escape: escapeHtml,
template: tmpl
});
}, argument = settings.variable || "obj";
template.source = "function(" + argument + "){\n" + source + "}";
return data ? template(data) : template;
}
var templateSettings = {
evaluate: /<%([\s\S]+?)%>/g,
interpolate: /<%=([\s\S]+?)%>/g,
escape: /<%-([\s\S]+?)%>/g
}, noMatch = /(.)^/, escapes = {
"'": "'",
"\\": "\\",
"\r": "r",
"\n": "n",
"\u2028": "u2028",
"\u2029": "u2029"
}, escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g, escapeChar = function(match) {
return "\\" + escapes[match];
}, innerContextVarName = "_amapui_tpl_cxt_";
return tmpl;
});
AMapUI.define("lib/SphericalMercator", [], function() {
function getScale(level) {
scaleCache[level] || (scaleCache[level] = 256 * Math.pow(2, level));
return scaleCache[level];
}
function project(lnglat) {
var lat = lnglat[1], x = lnglat[0] * deg2rad, y = lat * deg2rad;
y = Math.log(Math.tan(quadPI + y / 2));
return [ x, y ];
}
function transform(point, scale) {
scale = scale || 1;
var a = half2PI, b = .5, c = -a, d = .5;
return [ scale * (a * point[0] + b), scale * (c * point[1] + d) ];
}
function unproject(point) {
var lng = point[0] * rad2deg, lat = (2 * Math.atan(Math.exp(point[1])) - Math.PI / 2) * rad2deg;
return [ parseFloat(lng.toFixed(6)), parseFloat(lat.toFixed(6)) ];
}
function untransform(point, scale) {
var a = half2PI, b = .5, c = -a, d = .5;
return [ (point[0] / scale - b) / a, (point[1] / scale - d) / c ];
}
function lngLatToPointByScale(lnglat, scale, round) {
var p = transform(project(lnglat), scale);
if (round) {
p[0] = Math.round(p[0]);
p[1] = Math.round(p[1]);
}
return p;
}
function lngLatToPoint(lnglat, level, round) {
return lngLatToPointByScale(lnglat, getScale(level), round);
}
function pointToLngLat(point, level) {
var scale = getScale(level), untransformedPoint = untransform(point, scale);
return unproject(untransformedPoint);
}
function haversineDistance(point1, point2) {
var cos = Math.cos, lat1 = point1[1] * deg2rad, lon1 = point1[0] * deg2rad, lat2 = point2[1] * deg2rad, lon2 = point2[0] * deg2rad, dLat = lat2 - lat1, dLon = lon2 - lon1, a = (1 - cos(dLat) + (1 - cos(dLon)) * cos(lat1) * cos(lat2)) / 2;
return earthDiameter * Math.asin(Math.sqrt(a));
}
var scaleCache = {}, earthDiameter = 12756274, deg2rad = Math.PI / 180, rad2deg = 180 / Math.PI, quadPI = Math.PI / 4, half2PI = .5 / Math.PI;
return {
haversineDistance: haversineDistance,
getScale: getScale,
lngLatToPointByScale: lngLatToPointByScale,
pointToLngLat: pointToLngLat,
lngLatToPoint: lngLatToPoint
};
});
AMapUI.define("_auto/lib", function() {});
AMapUI.requireConf = {
"skipDataMain": true,
"config": {
"lib/conf": {
"productWebRoot": "//webapi.amap.com/ui",
"mainVersion": "1.1",
"patchVersion": "2",
"fullVersion": "1.1.2"
}
},
"map": {
"*": {
"css": "polyfill/require/require-css/css",
"text": "polyfill/require/require-text/text",
"json": "polyfill/require/require-json/json"
}
},
"shim": {
"jquery": {
"exports": "$"
},
"zepto": {
"exports": "$"
}
},
"paths": {
"jquery": "plug/ext/jquery-1.12.4.min",
"zepto": "plug/ext/zepto-1.2.0.min"
},
"baseUrl": "//webapi.amap.com/ui/1.1/",
"baseUrlProtocol": null
};
AMapUI.libConf = AMapUI.requireConf.config["lib/conf"];
AMapUI.uiMods = [
"ui/control/BasicControl",
"ui/geo/DistrictCluster",
"ui/geo/DistrictExplorer",
"ui/misc/MarkerList",
"ui/misc/MobiCityPicker",
"ui/misc/PathSimplifier",
"ui/misc/PoiPicker",
"ui/misc/PointSimplifier",
"ui/misc/PointSimplifr",
"ui/misc/PositionPicker",
"ui/overlay/AwesomeMarker",
"ui/overlay/SimpleInfoWindow",
"ui/overlay/SimpleMarker",
"ui/overlay/SvgMarker"
];
!function(ns, window) {
function getParameterByName(name) {
var match = new RegExp("[?&]" + name + "=([^&]*)").exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\+/g, " "));
}
function getAMapKey() {
return AMap.User ? AMap.User.key : "";
}
function arrForEach(array, callback, thisArg) {
if (array.forEach) return array.forEach(callback, thisArg);
for (var i = 0, len = array.length; i < len; i++) callback.call(thisArg, array[i], i);
}
function extendObj(dst) {
dst || (dst = {});
arrForEach(Array.prototype.slice.call(arguments, 1), function(source) {
if (source) for (var prop in source) source.hasOwnProperty(prop) && (dst[prop] = source[prop]);
});
return dst;
}
var libConf = ns.libConf, reqConf = ns.requireConf, uiMods = ns.uiMods || [];
ns.docProtocol = "https:" === document.location.protocol ? "https:" : "http:";
window.AMapUIProtocol && (ns.docProtocol = window.AMapUIProtocol);
window.AMapUIBaseUrl && (reqConf.baseUrl = window.AMapUIBaseUrl);
0 === reqConf.baseUrl.indexOf("//") && (reqConf.baseUrl = ns.docProtocol + reqConf.baseUrl);
var getAbsoluteUrl = function() {
var div = document.createElement("div");
div.innerHTML = "<a></a>";
return function(url) {
div.firstChild.href = url;
div.innerHTML = div.innerHTML;
return div.firstChild.href;
};
}();
ns.getAbsoluteUrl = getAbsoluteUrl;
getParameterByName("debugAMapUI") && (libConf.debugMode = !0);
var isDebugMode = !!libConf.debugMode;
ns.version = libConf.version = libConf.mainVersion + "." + libConf.patchVersion;
if (!isDebugMode) {
reqConf.bundles || (reqConf.bundles = {});
for (var reqBundles = reqConf.bundles, i = 0, len = uiMods.length; i < len; i++) {
var uiModId = uiMods[i];
reqBundles[uiModId] || (reqBundles[uiModId] = []);
reqBundles[uiModId].push(uiMods[i] + "/main");
}
}
ns.getBaseUrl = function() {
return reqConf.baseUrl;
};
reqConf.urlArgs = function(id, url) {
var args = [];
args.push("v=" + ns.version);
isDebugMode && args.push("_t=" + Date.now());
if (0 === id.indexOf("ui/")) {
var parts = id.split("/");
(3 === parts.length || 4 === parts.length && "main" === parts[3]) && args.push("mt=ui");
args.push("key=" + getAMapKey());
}
return (url.indexOf("?") < 0 ? "?" : "&") + args.join("&");
};
var requireContentName = "amap-ui-" + ns.version;
ns.require = ns.requirejs.config(extendObj({
context: requireContentName
}, reqConf));
ns.UI = ns.UI || {};
ns.findDefinedId = function(test, thisArg) {
var requirejs = ns.requirejs;
if (!requirejs.s || !requirejs.s.contexts) return null;
var contexts = requirejs.s.contexts[requireContentName];
if (!contexts) return null;
var defined = contexts.defined;
for (var k in defined) if (defined.hasOwnProperty(k) && test.call(thisArg, k)) return k;
return null;
};
ns.weakDefine = function(name) {
return ("string" != typeof name || !ns.require.defined(name)) && ns.define.apply(ns, arguments);
};
ns.defineTpl = function(name) {
if ("string" != typeof name) throw new Error("tpl name is supposed to be a string");
var args = Array.prototype.slice.call(arguments, 0);
args[0] = "polyfill/require/require-text/text!" + args[0];
return ns.define.apply(ns, args);
};
ns.setDomLibrary = function($) {
ns.require.undef("lib/$");
ns.define("lib/$", [], function() {
return $;
});
};
ns.inspectDomLibrary = function($) {
var isJQuery = $.fn && $.fn.jquery, isZepto = $ === window.Zepto;
return {
isJQuery: !!isJQuery,
isZepto: isZepto,
version: isJQuery ? $.fn.jquery : "unknown"
};
};
ns.versionCompare = function(left, right) {
if (typeof left + typeof right != "stringstring") return !1;
for (var a = left.split("."), b = right.split("."), i = 0, len = Math.max(a.length, b.length); i < len; i++) {
if (a[i] && !b[i] && parseInt(a[i], 10) > 0 || parseInt(a[i], 10) > parseInt(b[i], 10)) return 1;
if (b[i] && !a[i] && parseInt(b[i], 10) > 0 || parseInt(a[i], 10) < parseInt(b[i], 10)) return -1;
}
return 0;
};
ns.checkDomLibrary = function($, opts) {
opts = extendObj({
minJQueryVersion: "1.3"
}, opts);
var libInfo = ns.inspectDomLibrary($);
return !(libInfo.isJQuery && ns.versionCompare(libInfo.version, opts.minJQueryVersion) < 0) || "jQuery当前版本(" + libInfo.version + ")过低,请更新到 " + opts.minJQueryVersion + " 或以上版本!";
};
ns.setDebugMode = function(on) {
on = !!on;
ns.debugMode = on;
window.AMapUI_DEBUG = on;
ns.require([ "lib/utils" ], function(utils) {
utils.setDebugMode(ns.debugMode);
ns.debugMode && utils.logger.warn("Debug mode!");
});
};
ns.setDebugMode(isDebugMode);
ns.load = function(unames, callback, opts) {
ns.require([ "lib/utils" ], function(utils) {
utils.isArray(unames) || (unames = [ unames ]);
for (var uname, mods = [], modNameFilter = opts && opts.modNameFilter, i = 0, len = unames.length; i < len; i++) {
uname = unames[i];
modNameFilter && (uname = modNameFilter.call(null, uname));
ns.debugMode && 0 === uname.indexOf("ui/") && 3 === uname.split("/").length && (uname += "/main");
mods.push(uname);
}
ns.require(mods, callback);
});
};
ns.loadCss = function(urls, cb) {
ns.load(urls, cb, {
modNameFilter: function(url) {
return "css!" + getAbsoluteUrl(url);
}
});
};
ns.loadJs = function(urls, cb) {
ns.load(urls, cb, {
modNameFilter: function(url) {
return getAbsoluteUrl(url);
}
});
};
ns.loadText = function(urls, cb) {
ns.load(urls, cb, {
modNameFilter: function(url) {
return "text!" + getAbsoluteUrl(url);
}
});
};
ns.loadUI = function(unames, cb) {
ns.load(unames, cb, {
modNameFilter: function(uname) {
return "ui/" + uname;
}
});
};
ns.loadTpl = function(url, data, cb) {
ns.require([ "lib/underscore-tpl", "text!" + getAbsoluteUrl(url) ], function(template, text) {
cb(template(text, data), {
template: template,
text: text
});
});
};
isDebugMode || setTimeout(function() {
ns.loadJs(ns.docProtocol + "//webapi.amap.com/count?type=UIInit&k=" + getAMapKey());
}, 0);
}(AMapUI, window);
window.AMapUI = AMapUI;
}(window));