You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
18 KiB

3 months ago
var BMapLib=window.BMapLib=BMapLib||{};(function(){var c=c||{guid:"$BAIDU$"};(function(){window[c.guid]={};c.extend=function(g,e){for(var f in e){if(e.hasOwnProperty(f)){g[f]=e[f]}}return g};c.lang=c.lang||{};c.lang.guid=function(){return"TANGRAM__"+(window[c.guid]._counter++).toString(36)};window[c.guid]._counter=window[c.guid]._counter||1;window[c.guid]._instances=window[c.guid]._instances||{};c.lang.Class=function(e){this.guid=e||c.lang.guid();window[c.guid]._instances[this.guid]=this};window[c.guid]._instances=window[c.guid]._instances||{};c.lang.isString=function(e){return"[object String]"==Object.prototype.toString.call(e)};c.lang.isFunction=function(e){return"[object Function]"==Object.prototype.toString.call(e)};c.lang.Class.prototype.toString=function(){return"[object "+(this._className||"Object")+"]"};c.lang.Class.prototype.dispose=function(){delete window[c.guid]._instances[this.guid];for(var e in this){if(!c.lang.isFunction(this[e])){delete this[e]}}this.disposed=true};c.lang.Event=function(e,f){this.type=e;this.returnValue=true;this.target=f||null;this.currentTarget=null};c.lang.Class.prototype.addEventListener=function(h,g,f){if(!c.lang.isFunction(g)){return}!this.__listeners&&(this.__listeners={});var e=this.__listeners,i;if(typeof f=="string"&&f){if(/[^\w\-]/.test(f)){throw ("nonstandard key:"+f)}else{g.hashCode=f;i=f}}h.indexOf("on")!=0&&(h="on"+h);typeof e[h]!="object"&&(e[h]={});i=i||c.lang.guid();g.hashCode=i;e[h][i]=g};c.lang.Class.prototype.removeEventListener=function(g,f){if(c.lang.isFunction(f)){f=f.hashCode}else{if(!c.lang.isString(f)){return}}!this.__listeners&&(this.__listeners={});g.indexOf("on")!=0&&(g="on"+g);var e=this.__listeners;if(!e[g]){return}e[g][f]&&delete e[g][f]};c.lang.Class.prototype.dispatchEvent=function(h,e){if(c.lang.isString(h)){h=new c.lang.Event(h)}!this.__listeners&&(this.__listeners={});e=e||{};for(var g in e){h[g]=e[g]}var g,f=this.__listeners,j=h.type;h.target=h.target||this;h.currentTarget=this;j.indexOf("on")!=0&&(j="on"+j);c.lang.isFunction(this[j])&&this[j].apply(this,arguments);if(typeof f[j]=="object"){for(g in f[j]){f[j][g].apply(this,arguments)}}return h.returnValue};c.lang.inherits=function(k,i,h){var g,j,e=k.prototype,f=new Function();f.prototype=i.prototype;j=k.prototype=new f();for(g in e){j[g]=e[g]}k.prototype.constructor=k;k.superClass=i.prototype;if("string"==typeof h){j._className=h}};c.dom=c.dom||{};c._g=c.dom._g=function(e){if(c.lang.isString(e)){return document.getElementById(e)}return e};c.g=c.dom.g=function(e){if("string"==typeof e||e instanceof String){return document.getElementById(e)}else{if(e&&e.nodeName&&(e.nodeType==1||e.nodeType==9)){return e}}return null};c.insertHTML=c.dom.insertHTML=function(h,e,g){h=c.dom.g(h);var f,i;if(h.insertAdjacentHTML){h.insertAdjacentHTML(e,g)}else{f=h.ownerDocument.createRange();e=e.toUpperCase();if(e=="AFTERBEGIN"||e=="BEFOREEND"){f.selectNodeContents(h);f.collapse(e=="AFTERBEGIN")}else{i=e=="BEFOREBEGIN";f[i?"setStartBefore":"setEndAfter"](h);f.collapse(i)}f.insertNode(f.createContextualFragment(g))}return h};c.ac=c.dom.addClass=function(k,m){k=c.dom.g(k);var f=m.split(/\s+/),e=k.className,j=" "+e+" ",h=0,g=f.length;for(;h<g;h++){if(j.indexOf(" "+f[h]+" ")<0){e+=(e?" ":"")+f[h]}}k.className=e;return k};c.event=c.event||{};c.event._listeners=c.event._listeners||[];c.on=c.event.on=function(f,i,k){i=i.replace(/^on/i,"");f=c._g(f);var j=function(m){k.call(f,m)},e=c.event._listeners,h=c.event._eventFilter,l,g=i;i=i.toLowerCase();if(h&&h[i]){l=h[i](f,i,j);g=l.type;j=l.listener}if(f.addEventListener){f.addEventListener(g,j,false)}else{if(f.attachEvent){f.attachEvent("on"+g,j)}}e[e.length]=[f,i,k,j,g];return f};c.un=c.event.un=function(g,j,f){g=c._g(g);j=j.replace(/^on/i,"").toLowerCase();var m=c.event._listeners,h=m.length,i=!f,l,k,e;while(h--){l=m[h];if(l[1]===j&&l[0]===g&&(i||l[2]===f)){k=l[4];e=l[3];if(g.removeEventListener){g.removeEventListener(k,e,false)}else{if(g.detachEvent){g.detachEvent("on"+k,e)}}m.splice(h,1)}}return g};c.preventDefault=c.event.preventDefault=function(e){if(e.preventDefault){e.preventDe