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
4.5 KiB

/**/_jsload2 && _jsload2('clayer', 'x.extend(rb.prototype,{ll:{},Kj:[],fv:"",Gq:"",eH:"",ml:p,Mg:p,Lg:p,Kg:[],dH:0,Nz:t(),Jz:t(),Zu:t(),Td:function(){this.mH()},ra:function(a,b){Hd.prototype.ra.call(this,a,b);this.ll={};this.Kj=[];this.D=a;this.mH()},St:ea(o),remove:function(){Hd.prototype.remove.call(this);this.wU()},mH:function(){var a=this,b=a.D;b&&(this.Nz=function(b){a.PT(b)},this.Jz=function(b){a.qT(b)},this.Zu=function(b){a.pT(b)},b.addEventListener("mousemove",this.Nz),b.addEventListener("onhotspotover",this.Jz),b.addEventListener("onhotspotout", this.Zu),b.addEventListener("onzoomstart",this.Zu))},wU:function(){var a=this.D;a&&(a.removeEventListener("mousemove",this.Nz),a.removeEventListener("onhotspotover",this.Jz),a.removeEventListener("onhotspotout",this.Zu))},PT:function(a){var b=this,c=b.D,d=c.oa();if(c.ga()<this.fc||c.Wb())b.RB();else if(a=d.Nm().Fl(a.point),d=d.k.Ob,a=new R(Math.floor(a.x*Math.pow(2,c.ga()-18)),Math.floor(a.y*Math.pow(2,c.ga()-18))),d=new R(Math.floor(a.x/d),Math.floor(a.y/d)),this.Gq=c=d.x+"_"+d.y+"_"+c.ga(),this.ll[c]){if(this.fv!= c){b.RB();b.lH(this.ll[c]);this.fv=c;for(var d=-1,a=0,e=this.Kj.length;a<e;a++)if(c==this.Kj[a]){d=a;break}0<=d&&(this.Kj.splice(d,d),this.Kj.push(c))}}else if(this.eH!=c){this.eH=c;d=Sd[parseInt(Math.random()*Sd.length)];a=b.oc;c=d+"/data?grids="+c+"&q="+a.qn+"&tags="+a.uz+"&filter="+a.filter+"&sortby="+a.oz+"&ak="+a.hm+"&page_size="+a.fO+"&age="+a.Uw;b.Bf?c+="&geotable_id="+b.Bf:b.jo&&(c+="&databox_id="+b.jo);var f=(1E5*Math.random()).toFixed(0);!B._rd&&(B._rd={});B._rd["_cbk"+f]=function(a){b.iT(a); delete B._rd["_cbk"+f]};sa(c+("&callback=BMap._rd._cbk"+f))}},iT:function(a){var b=this.D,c=a.content;if(!(a.status!=this.dH||!c||1>c.length)){for(var a=[],d=c[0].data,b=b.oa().Nm(),e=0,f=d.length;e<f;e++){var g=d[e][2].replace(rb.KU,"").split(","),g=b.rh(new K(g[0],g[1]));a.push({pt:g,userdata:{name:d[e][0]||"name",size:d[e][4]?d[e][4].split("|"):[10,13],uid:d[e][1]||"",QO:d[e][3]||"sid1"}})}c=c[0].grid.join("_");this.ll[c]=a;this.Kj.push(c);30<this.Kj.length&&(c=this.Kj.shift(),delete this.ll[c], delete c);this.fv!=this.Gq&&(this.RB(),this.ll[this.Gq]&&(this.lH(this.ll[this.Gq]),this.fv=this.Gq))}},lH:function(a){for(var b=this.D,c=0,d=a.length;c<d;c++){var e=a[c].userdata.size,f=e[0]/2,e=e[1]/2,f=new mb(a[c].pt,{offsets:[e,f,e,f],userData:a[c].userdata});b.Qw(f,this.oc.Kk)}},RB:function(){this.D.rm(this.oc.Kk)},qT:function(a){if(a.spots&&!(1>a.spots.length||a.spots[0].tag!=this.oc.Kk)){this.Kg=a.spots;var b=this,a=this.Kg[0].getUserData().size[0],c="",d=b.D,e="",f=b.oc.nZ;0<this.Kg.length&& (c=this.Kg[0].getUserData().name);if(this.Mg)this.Mg.ta(this.Kg[0].ia()),this.Lg.ad(c),this.Lg.Ye(new M(a,0)),this.Mg.show(),c?this.Lg.show():this.Lg.U();else{var g=this.Kg[0].getUserData().size,e=this.Kg[0].getUserData().QO,i=this.Bf||this.jo;this.ml=new nd(I.pa+"blank.gif",new M(g[0],g[1]),{anchor:new M(g[0]/2+1,g[1]/2+1)});this.ZS(i,e,function(){b.Mg&&b.Mg.Vb(b.ml)});this.Mg=new W(this.Kg[0].ia(),{icon:this.ml,enableMassClear:q});d.Ka(this.Mg);this.Lg=new ud(c,{offset:new M(a,0)});this.Lg.bd({backgroundColor:f.backgroundColor, borderColor:f.borderColor});this.Mg.zn(this.Lg);c?this.Lg.show():this.Lg.U();this.Mg.addEventListener("onclick",function(){if(!(b.Kg.length<1)&&b.Kg[0].getUserData().uid){var a=b.oc,c=a.OY;if(b.Bf)c=a.PY;a=c+b.Kg[0].getUserData().uid+"?scope=2&ak="+a.hm;b.Bf&&(a=a+("&geotable_id="+b.Bf));var d=(Math.random()*1E5).toFixed(0);!B._rd&&(B._rd={});B._rd["_cbk"+d]=function(a){b.YS(a);delete B._rd["_cbk"+d]};sa(a+("&callback=BMap._rd._cbk"+d))}})}}},YS:function(a){var b=a.content;this.Bf&&(b=a.contents[0]); if(a&&a.status==this.dH&&b){var a={poiId:b.uid||"",databoxId:b.databox_id||"",title:this.Bf?b.title:b.name,address:this.Bf?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.Bf?new K(b.location[0],b.location[1]):new K(b.longitude,b.latitude),tags:b.tag&&b.tag.replace(rb.NU,"").split(rb.LU),typeId:1*b.cla||-1,extendedData:b.ext|| {}},c=new x.lang.Iz("onhotspotclick");c.customPoi=a;c.content=b;this.dispatchEvent(c)}},pT:function(){this.Mg&&this.Mg.U();this.Lg&&this.Lg.U()},ZS:function(a,b,c){var d=this,e=Td+"?method=getstyle&databox="+a+"&sid="+b,f=(1E5*Math.random()).toFixed(0);if(!d.ml||!(d.ml.databoxid==a&&d.ml.sid==b))!B._rd&&(B._rd={}),B._rd["_cbk"+f]=function(a){var b="";0==a.status&&(b="data:image/png;base64,"+a.content.sid1);0<b.length&&(d.ml.BO(b),c&&c(a));delete B._rd["_cbk"+f]},sa(e+("&callback=BMap._rd._cbk"+f))}}); ');