/**/_jsload2&&_jsload2('clayer', 'z.extend(pb.prototype,{Ok:{},sj:[],eu:"",Gp:"",IF:"",Pk:s,Bg:s,Ag:s,zg:[],HF:0,vy:u(),py:u(),$t:u(),Qd:function(){this.PF()},xa:function(a,b){Mc.prototype.xa.call(this,a,b);this.Ok={};this.sj=[];this.M=a;this.PF()},Ks:ea(p),remove:function(){Mc.prototype.remove.call(this);this.HS()},PF:function(){var a=this,b=a.M;b&&(this.vy=function(b){a.$R(b)},this.py=function(b){a.zR(b)},this.$t=function(b){a.yR(b)},b.addEventListener("mousemove",this.vy),b.addEventListener("onhotspotover",this.py),b.addEventListener("onhotspotout", this.$t),b.addEventListener("onzoomstart",this.$t))},HS:function(){var a=this.M;a&&(a.removeEventListener("mousemove",this.vy),a.removeEventListener("onhotspotover",this.py),a.removeEventListener("onhotspotout",this.$t))},$R:function(a){var b=this,c=b.M,e=c.va();if(c.ka()<this.gc||c.Nd())b.BA();else if(a=e.nk().qg(a.point),e=e.Id(),a=new R(Math.floor(a.x*Math.pow(2,c.ka()-18)),Math.floor(a.y*Math.pow(2,c.ka()-18))),e=new R(Math.floor(a.x/e),Math.floor(a.y/e)),this.Gp=c=e.x+"_"+e.y+"_"+c.ka(),this.Ok[c]){if(this.eu!= c){b.BA();b.OF(this.Ok[c]);this.eu=c;for(var e=-1,a=0,f=this.sj.length;a<f;a++)if(c==this.sj[a]){e=a;break}0<=e&&(this.sj.splice(e,e),this.sj.push(c))}}else if(this.IF!=c){this.IF=c;e=Vc[parseInt(Math.random()*Vc.length)];a=b.$a;c=e+"/data?grids="+c+"&q="+a.ct+"&tags="+a.ME+"&filter="+a.filter+"&sortby="+a.pN+"&ak="+a.lB+"&page_size="+a.AM+"&age="+a.SI;b.xf?c+="&geotable_id="+b.xf:b.hn&&(c+="&databox_id="+b.hn);var g=(1E5*Math.random()).toFixed(0);!D._rd&&(D._rd={});D._rd["_cbk"+g]=function(a){b.rR(a); delete D._rd["_cbk"+g]};pa(c+("&callback=BMap._rd._cbk"+g))}},rR:function(a){var b=this.M,c=a.content;if(!(a.status!=this.HF||!c||1>c.length)){for(var a=[],e=c[0].data,b=b.va().nk(),f=0,g=e.length;f<g;f++){var i=e[f][2].replace(pb.US,"").split(","),i=b.eh(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]||"",Ub:e[f][3]||"sid1"}})}c=c[0].grid.join("_");this.Ok[c]=a;this.sj.push(c);30<this.sj.length&&(c=this.sj.shift(),delete this.Ok[c], delete c);this.eu!=this.Gp&&(this.BA(),this.Ok[this.Gp]&&(this.OF(this.Ok[this.Gp]),this.eu=this.Gp))}},OF:function(a){for(var b=this.M,c=0,e=a.length;c<e;c++){var f=a[c].userdata.size,g=f[0]/2,f=f[1]/2,g=new kb(a[c].pt,{offsets:[f,g,f,g],userData:a[c].userdata});b.eB(g,this.$a.mD)}},BA:function(){this.M.bw(this.$a.mD)},zR:function(a){if(a.spots&&!(1>a.spots.length||a.spots[0].tag!=this.$a.mD)){this.zg=a.spots;var b=this,a=this.zg[0].getUserData().size[0],c="",e=b.M,f="",g=b.$a.aY;0<this.zg.length&& (c=this.zg[0].getUserData().name);if(this.Bg)this.Bg.ua(this.zg[0].ja()),this.Ag.cd(c),this.Ag.ie(new P(a,0)),this.Bg.show(),c?this.Ag.show():this.Ag.aa();else{var i=this.zg[0].getUserData().size,f=this.zg[0].getUserData().Ub,k=this.xf||this.hn;this.Pk=new qc(H.sa+"blank.gif",new P(i[0],i[1]),{anchor:new P(i[0]/2+1,i[1]/2+1)});this.iR(k,f,function(){b.Bg&&b.Bg.Tb(b.Pk)});this.Bg=new V(this.zg[0].ja(),{icon:this.Pk,enableMassClear:t});e.Pa(this.Bg);this.Ag=new uc(c,{offset:new P(a,0)});this.Ag.Ld({backgroundColor:g.backgroundColor, borderColor:g.borderColor});this.Bg.Dm(this.Ag);c?this.Ag.show():this.Ag.aa();this.Bg.addEventListener("onclick",function(){if(!(b.zg.length<1)&&b.zg[0].getUserData().uid){var a=b.$a,c=a.rX;if(b.xf)c=a.sX;a=c+b.zg[0].getUserData().uid+"?scope=2&ak="+a.lB;b.xf&&(a=a+("&geotable_id="+b.xf));var e=(Math.random()*1E5).toFixed(0);!D._rd&&(D._rd={});D._rd["_cbk"+e]=function(a){b.hR(a);delete D._rd["_cbk"+e]};pa(a+("&callback=BMap._rd._cbk"+e))}})}}},hR:function(a){var b=a.content;this.xf&&(b=a.contents[0]); if(a&&a.status==this.HF&&b){var a={poiId:b.uid||"",databoxId:b.databox_id||"",title:this.xf?b.title:b.name,address:this.xf?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.xf?new J(b.location[0],b.location[1]):new J(b.longitude,b.latitude),tags:b.tag&&b.tag.replace(pb.XS,"").split(pb.VS),typeId:1*b.cla||-1,extendedData:b.ext|| {}},c=new z.lang.Zt("onhotspotclick");c.customPoi=a;c.content=b;this.dispatchEvent(c)}},yR:function(){this.Bg&&this.Bg.aa();this.Ag&&this.Ag.aa()},iR:function(a,b,c){var e=this,f=Wc+"?method=getstyle&databox="+a+"&sid="+b,g=(1E5*Math.random()).toFixed(0);if(!e.Pk||!(e.Pk.databoxid==a&&e.Pk.sid==b))!D._rd&&(D._rd={}),D._rd["_cbk"+g]=function(a){var b="";0==a.status&&(b="data:image/png;base64,"+a.content.sid1);0<b.length&&(e.Pk.aN(b),c&&c(a));delete D._rd["_cbk"+g]},pa(f+("&callback=BMap._rd._cbk"+ g))}}); ');
