1 |
- _jsload2&&_jsload2('clayer', 'z.extend(nb.prototype,{cl:{},Bj:[],Pu:"",jq:"",MG:"",dl:s,Jg:s,Ig:s,Hg:[],LG:0,pz:u(),lz:u(),Ku:u(),Sd:function(){this.UG()},na:function(a,b){Mc.prototype.na.call(this,a,b);this.cl={};this.Bj=[];this.B=a;this.UG()},zt:ca(q),remove:function(){Mc.prototype.remove.call(this);this.fU()},UG:function(){var a=this,b=a.B;b&&(this.pz=function(b){a.yT(b)},this.lz=function(b){a.XS(b)},this.Ku=function(b){a.WS(b)},b.addEventListener("mousemove",this.pz),b.addEventListener("onhotspotover",this.lz),b.addEventListener("onhotspotout", this.Ku),b.addEventListener("onzoomstart",this.Ku))},fU:function(){var a=this.B;a&&(a.removeEventListener("mousemove",this.pz),a.removeEventListener("onhotspotover",this.lz),a.removeEventListener("onhotspotout",this.Ku))},yT:function(a){var b=this,c=b.B,e=c.oa();if(c.fa()<this.gc||c.Sb())b.xB();else if(a=e.wm().kh(a.point),e=e.$c(),a=new Q(Math.floor(a.x*Math.pow(2,c.fa()-18)),Math.floor(a.y*Math.pow(2,c.fa()-18))),e=new Q(Math.floor(a.x/e),Math.floor(a.y/e)),this.jq=c=e.x+"_"+e.y+"_"+c.fa(),this.cl[c]){if(this.Pu!= c){b.xB();b.TG(this.cl[c]);this.Pu=c;for(var e=-1,a=0,f=this.Bj.length;a<f;a++)if(c==this.Bj[a]){e=a;break}0<=e&&(this.Bj.splice(e,e),this.Bj.push(c))}}else if(this.MG!=c){this.MG=c;e=Wc[parseInt(Math.random()*Wc.length)];a=b.ub;c=e+"/data?grids="+c+"&q="+a.Wm+"&tags="+a.pu+"&filter="+a.filter+"&sortby="+a.Vy+"&ak="+a.Vl+"&page_size="+a.ON+"&age="+a.Gw;b.Cf?c+="&geotable_id="+b.Cf:b.Rn&&(c+="&databox_id="+b.Rn);var g=(1E5*Math.random()).toFixed(0);!B._rd&&(B._rd={});B._rd["_cbk"+g]=function(a){b.PS(a); delete B._rd["_cbk"+g]};oa(c+("&callback=BMap._rd._cbk"+g))}},PS:function(a){var b=this.B,c=a.content;if(!(a.status!=this.LG||!c||1>c.length)){for(var a=[],e=c[0].data,b=b.oa().wm(),f=0,g=e.length;f<g;f++){var i=e[f][2].replace(nb.tU,"").split(","),i=b.nh(new J(i[0],i[1]));a.push({pt:i,userdata:{name:e[f][0]||"name",size:e[f][4]?e[f][4].split("|"):[10,13],uid:e[f][1]||"",BO:e[f][3]||"sid1"}})}c=c[0].grid.join("_");this.cl[c]=a;this.Bj.push(c);30<this.Bj.length&&(c=this.Bj.shift(),delete this.cl[c], delete c);this.Pu!=this.jq&&(this.xB(),this.cl[this.jq]&&(this.TG(this.cl[this.jq]),this.Pu=this.jq))}},TG:function(a){for(var b=this.B,c=0,e=a.length;c<e;c++){var f=a[c].userdata.size,g=f[0]/2,f=f[1]/2,g=new ib(a[c].pt,{offsets:[f,g,f,g],userData:a[c].userdata});b.Cw(g,this.ub.Fk)}},xB:function(){this.B.dm(this.ub.Fk)},XS:function(a){if(a.spots&&!(1>a.spots.length||a.spots[0].tag!=this.ub.Fk)){this.Hg=a.spots;var b=this,a=this.Hg[0].getUserData().size[0],c="",e=b.B,f="",g=b.ub.eZ;0<this.Hg.length&& (c=this.Hg[0].getUserData().name);if(this.Jg)this.Jg.sa(this.Hg[0].ga()),this.Ig.dd(c),this.Ig.Ze(new O(a,0)),this.Jg.show(),c?this.Ig.show():this.Ig.U();else{var i=this.Hg[0].getUserData().size,f=this.Hg[0].getUserData().BO,k=this.Cf||this.Rn;this.dl=new qc(G.qa+"blank.gif",new O(i[0],i[1]),{anchor:new O(i[0]/2+1,i[1]/2+1)});this.GS(k,f,function(){b.Jg&&b.Jg.Rb(b.dl)});this.Jg=new U(this.Hg[0].ga(),{icon:this.dl,enableMassClear:t});e.Ga(this.Jg);this.Ig=new uc(c,{offset:new O(a,0)});this.Ig.Md({backgroundColor:g.backgroundColor, borderColor:g.borderColor});this.Jg.dn(this.Ig);c?this.Ig.show():this.Ig.U();this.Jg.addEventListener("onclick",function(){if(!(b.Hg.length<1)&&b.Hg[0].getUserData().uid){var a=b.ub,c=a.BY;if(b.Cf)c=a.CY;a=c+b.Hg[0].getUserData().uid+"?scope=2&ak="+a.Vl;b.Cf&&(a=a+("&geotable_id="+b.Cf));var e=(Math.random()*1E5).toFixed(0);!B._rd&&(B._rd={});B._rd["_cbk"+e]=function(a){b.FS(a);delete B._rd["_cbk"+e]};oa(a+("&callback=BMap._rd._cbk"+e))}})}}},FS:function(a){var b=a.content;this.Cf&&(b=a.contents[0]); if(a&&a.status==this.LG&&b){var a={poiId:b.uid||"",databoxId:b.databox_id||"",title:this.Cf?b.title:b.name,address:this.Cf?b.address:b.addr,phoneNumber:b.tel||"",postcode:b.zip||"",provinceCode:1*b.province_id||-1,province:b.province||"",cityCode:1*b.city_id||-1,city:b.city||"",districtCode:1*b.district_id||-1,district:b.district||"",point:this.Cf?new J(b.location[0],b.location[1]):new J(b.longitude,b.latitude),tags:b.tag&&b.tag.replace(nb.wU,"").split(nb.uU),typeId:1*b.cla||-1,extendedData:b.ext|| {}},c=new z.lang.Ju("onhotspotclick");c.customPoi=a;c.content=b;this.dispatchEvent(c)}},WS:function(){this.Jg&&this.Jg.U();this.Ig&&this.Ig.U()},GS:function(a,b,c){var e=this,f=Xc+"?method=getstyle&databox="+a+"&sid="+b,g=(1E5*Math.random()).toFixed(0);if(!e.dl||!(e.dl.databoxid==a&&e.dl.sid==b))!B._rd&&(B._rd={}),B._rd["_cbk"+g]=function(a){var b="";0==a.status&&(b="data:image/png;base64,"+a.content.sid1);0<b.length&&(e.dl.mO(b),c&&c(a));delete B._rd["_cbk"+g]},oa(f+("&callback=BMap._rd._cbk"+g))}}); ');
|