clayer_pt3hj5.js 4.8 KB

12345678
  1. /* 百度地图API V2 模块
  2. * 此模块必须配套使用baidumap_offline_v2_20160822.js对
  3. * 获取模块的方法:
  4. * http://api0.map.bdimg.com/getmodules?v=2.0&mod=模块1,模块2
  5. * 模块名称就是文件名
  6. * www.xiaoguo123.com 整理
  7. */
  8. _jsload2&&_jsload2('clayer', 'x.extend(nb.prototype,{Yk:{},Dj:[],Eu:"",fq:"",vG:"",Zk:p,Ig:p,Hg:p,Gg:[],uG:0,dz:s(),$y:s(),xu:s(),Od:function(){this.DG()},qa:function(a,b){Ec.prototype.qa.call(this,a,b);this.Yk={};this.Dj=[];this.C=a;this.DG()},lt:ca(o),remove:function(){Ec.prototype.remove.call(this);this.FT()},DG:function(){var a=this,b=a.C;b&&(this.dz=function(b){a.YS(b)},this.$y=function(b){a.yS(b)},this.xu=function(b){a.xS(b)},b.addEventListener("mousemove",this.dz),b.addEventListener("onhotspotover",this.$y),b.addEventListener("onhotspotout", this.xu),b.addEventListener("onzoomstart",this.xu))},FT:function(){var a=this.C;a&&(a.removeEventListener("mousemove",this.dz),a.removeEventListener("onhotspotover",this.$y),a.removeEventListener("onhotspotout",this.xu))},YS:function(a){var b=this,c=b.C,d=c.oa();if(c.fa()<this.fc||c.Ub())b.lB();else if(a=d.bp().nh(a.point),d=d.k.Ob,a=new Q(Math.floor(a.x*Math.pow(2,c.fa()-18)),Math.floor(a.y*Math.pow(2,c.fa()-18))),d=new Q(Math.floor(a.x/d),Math.floor(a.y/d)),this.fq=c=d.x+"_"+d.y+"_"+c.fa(),this.Yk[c]){if(this.Eu!= c){b.lB();b.CG(this.Yk[c]);this.Eu=c;for(var d=-1,a=0,e=this.Dj.length;a<e;a++)if(c==this.Dj[a]){d=a;break}0<=d&&(this.Dj.splice(d,d),this.Dj.push(c))}}else if(this.vG!=c){this.vG=c;d=Oc[parseInt(Math.random()*Oc.length)];a=b.oc;c=d+"/data?grids="+c+"&q="+a.Wm+"&tags="+a.eu+"&filter="+a.filter+"&sortby="+a.Gy+"&ak="+a.Sl+"&page_size="+a.qN+"&age="+a.sw;b.xf?c+="&geotable_id="+b.xf:b.Pn&&(c+="&databox_id="+b.Pn);var f=(1E5*Math.random()).toFixed(0);!z._rd&&(z._rd={});z._rd["_cbk"+f]=function(a){b.qS(a); delete z._rd["_cbk"+f]};Qb(c+("&callback=BMap._rd._cbk"+f))}},qS:function(a){var b=this.C,c=a.content;if(!(a.status!=this.uG||!c||1>c.length)){for(var a=[],d=c[0].data,b=b.oa().bp(),e=0,f=d.length;e<f;e++){var g=d[e][2].replace(nb.UT,"").split(","),g=b.qh(new H(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]||"",ZN:d[e][3]||"sid1"}})}c=c[0].grid.join("_");this.Yk[c]=a;this.Dj.push(c);30<this.Dj.length&&(c=this.Dj.shift(),delete this.Yk[c], delete c);this.Eu!=this.fq&&(this.lB(),this.Yk[this.fq]&&(this.CG(this.Yk[this.fq]),this.Eu=this.fq))}},CG:function(a){for(var b=this.C,c=0,d=a.length;c<d;c++){var e=a[c].userdata.size,f=e[0]/2,e=e[1]/2,f=new ib(a[c].pt,{offsets:[e,f,e,f],userData:a[c].userdata});b.nw(f,this.oc.Bk)}},lB:function(){this.C.bm(this.oc.Bk)},yS:function(a){if(a.spots&&!(1>a.spots.length||a.spots[0].tag!=this.oc.Bk)){this.Gg=a.spots;var b=this,a=this.Gg[0].getUserData().size[0],c="",d=b.C,e="",f=b.oc.vY;0<this.Gg.length&& (c=this.Gg[0].getUserData().name);if(this.Ig)this.Ig.sa(this.Gg[0].ha()),this.Hg.bd(c),this.Hg.Te(new L(a,0)),this.Ig.show(),c?this.Hg.show():this.Hg.U();else{var g=this.Gg[0].getUserData().size,e=this.Gg[0].getUserData().ZN,i=this.xf||this.Pn;this.Zk=new nc(F.pa+"blank.gif",new L(g[0],g[1]),{anchor:new L(g[0]/2+1,g[1]/2+1)});this.gS(i,e,function(){b.Ig&&b.Ig.Tb(b.Zk)});this.Ig=new T(this.Gg[0].ha(),{icon:this.Zk,enableMassClear:q});d.Ia(this.Ig);this.Hg=new rc(c,{offset:new L(a,0)});this.Hg.Kd({backgroundColor:f.backgroundColor, borderColor:f.borderColor});this.Ig.fn(this.Hg);c?this.Hg.show():this.Hg.U();this.Ig.addEventListener("onclick",function(){if(!(b.Gg.length<1)&&b.Gg[0].getUserData().uid){var a=b.oc,c=a.VX;if(b.xf)c=a.WX;a=c+b.Gg[0].getUserData().uid+"?scope=2&ak="+a.Sl;b.xf&&(a=a+("&geotable_id="+b.xf));var d=(Math.random()*1E5).toFixed(0);!z._rd&&(z._rd={});z._rd["_cbk"+d]=function(a){b.fS(a);delete z._rd["_cbk"+d]};Qb(a+("&callback=BMap._rd._cbk"+d))}})}}},fS:function(a){var b=a.content;this.xf&&(b=a.contents[0]); if(a&&a.status==this.uG&&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 H(b.location[0],b.location[1]):new H(b.longitude,b.latitude),tags:b.tag&&b.tag.replace(nb.XT,"").split(nb.VT),typeId:1*b.cla||-1,extendedData:b.ext|| {}},c=new x.lang.Zy("onhotspotclick");c.customPoi=a;c.content=b;this.dispatchEvent(c)}},xS:function(){this.Ig&&this.Ig.U();this.Hg&&this.Hg.U()},gS:function(a,b,c){var d=this,e=Pc+"?method=getstyle&databox="+a+"&sid="+b,f=(1E5*Math.random()).toFixed(0);if(!d.Zk||!(d.Zk.databoxid==a&&d.Zk.sid==b))!z._rd&&(z._rd={}),z._rd["_cbk"+f]=function(a){var b="";0==a.status&&(b="data:image/png;base64,"+a.content.sid1);0<b.length&&(d.Zk.MN(b),c&&c(a));delete z._rd["_cbk"+f]},Qb(e+("&callback=BMap._rd._cbk"+f))}}); ');