vector_0tuckd.js 9.1 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('vector', 'x.extend(Lc.prototype,{qa:function(a,b){Ec.prototype.qa.call(this,a,b);this.Cg={};this.cr(a);this.pq();this.Lq()},remove:function(){var a=this.C;Ec.prototype.remove.call(this);a&&(a.removeEventListener("zoomend",this.Xk),a.removeEventListener("moveend",this.Dk),a.removeEventListener("resize",this.Jk),a.removeEventListener("hotspotclick",this.OL),a.bm(this.k.Bk))},cr:function(a){this.C=a;this.IB=this.Pb;this.yc=this.C.K.devicePixelRatio;this.mn=62;a.bm(this.k.Bk);for(var b in this.ip)delete this.ip[b]}, pq:function(){var a=this,b=this.C;a.Xk=function(b){a.Lq(b)};a.Dk=function(b){a.Lq(b)};a.Jk=function(b){a.Lq(b)};a.OL=function(b){0<b.spots.length&&a.PT(b.spots[0].getUserData().uid)};b.addEventListener("zoomend",a.Xk);b.addEventListener("moveend",a.Dk);b.addEventListener("resize",a.Jk);b.addEventListener("hotspotclick",a.OL)},PT:function(a){var b=this,c=(1E5*Math.random()).toFixed(0);!z._rd&&(z._rd={});z._rd["_cbk"+c]=function(a){b.YQ(a);delete z._rd["_cbk"+c]};var d=b.aW;this.k.fh&&(d=b.bW);a=d+ a+"?scope=2&ak="+this.k.Sl+"&callback=BMap._rd._cbk"+c;this.k.fh&&(a+="&geotable_id="+this.k.fh);Qb(a)},YQ:function(a){var b=a.content;this.k.fh&&(b=a.contents[0]);if(a&&0==a.status&&b){var a={poiId:b.uid||"",databoxId:b.databox_id||"",title:this.k.fh?b.title:b.name,address:this.k.fh?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.k.fh? new H(b.location[0],b.location[1]):new H(b.longitude,b.latitude),tags:b.tag&&b.tag.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g,"").split(/\\s+/),typeId:1*b.cla||-1,extendedData:b.ext||{}},c=new N("onhotspotclick");c.customPoi=a;c.content=b;this.My&&this.My.dispatchEvent(c);this.dispatchEvent(c)}},Lq:function(){var a=this.C,b=a.fa(),c=a.bb.xm(this.IB,"yun",this.mn);if(a.Ub()){this.Hm||(this.Hm=o,0<c.length&&(this.Ob=a.oa().k.Ob));this.$m=Math.pow(2,18-b);this.th=c.length;a=0;for(b=c.length;a<b;a++)this.sr(c[a][0], c[a][1],c[a][2])}},sr:function(a,b,c){var d=this,e=d.map,f=e.Ja(),g=new H(f.lng,f.lat),i=e.fa(),e=Oc[Math.abs(a+b)%Oc.length]+"/data?grids="+a+"_"+b+"_"+i+"&q="+this.k.Wm+"&tags="+this.k.eu+"&filter="+this.k.filter+"&sortby="+this.k.Gy+"&ak="+this.k.Sl+"&age="+this.k.sw,e=this.k.fh?e+("&geotable_id="+this.k.fh):e+("&databox_id="+this.k.xK);c.Xe=q;Qb(e,function(e){var e=0==e.status?e.content[0].data:[],f=d.map,m=f.Ja(),f=f.fa();m.mb(g)&&f==i&&(d.Qn(e,c,a,b,i),d.th--,0==d.th&&d.My.dispatchEvent("oncustomlayerloaded"))})}, Qn:function(a,b,c,d,e){var f=b.getContext("2d");1<this.yc&&!b.lg&&(f.scale(this.yc,this.yc),b.lg=o);b.HB||(b.HB=o,f.translate(this.mn/2,this.mn/2));for(var e="hotSpotTile_"+c+"_"+d+"_"+e,g=0,i=a.length;g<i;g++)this.qW(f,a[g],c,d,e,b)},qW:function(a,b,c,d,e,f){var g=this,i=b[0],k=b[1],l=b[2],m=b[3],g=this,n=this.Ob,b=this.$m,c=c*b*n,d=(d+1)*b*n;/^POINT\\((.*)\\)$/.test(l);var l=RegExp.$1.split(","),u=l[0],v=l[1],w=(u-c)/b,y=(d-v)/b,C=new Image;C.onload=function(){var b=this.width,c=this.height;a.drawImage(this, w-b/2,y-c);g.ip[e]||(b={userData:{name:i,uid:k},offsets:[c,b/2,0,b/2]},b=new ib(R.Eb(new H(u,v)),b),g.C.nw(b,g.k.Bk));setTimeout(function(){g.ip[e]=o;f.Xe=o},1E3);delete this.onload};this.FX(m,function(a){""==m&&(m="sid1");C.src=a&&a.content&&a.content[m]&&""!=a.content[m]?"data:image/png;base64,"+a.content[m]:F.pa+"madian.png"})},L3:function(){if(this.Pb){for(var a=this.Pb,b=0,c=a.childNodes.length;b<c;b++)a.childNodes[b].Xe=q;this.C.bm(this.k.Bk);for(var d in this.ip)delete this.ip[d];this.Lq()}}, FX:function(a,b){var c=this,d=this.k.xK,e=this.k.q_,f=this.k.Sl;""==a&&(a="sid1");if(this.Cg[a]&&this.Cg[a].data)b(this.Cg[a].data);else{this.Cg[a]||(this.Cg[a]={},this.Cg[a].aC=[]);this.Cg[a].aC.push(b);var g=z.Hc+"style/poi/rangestyle?method=getstyle";this.k.fh&&(d=this.k.fh);g+="&databox="+d+"&sid="+a+"&ak="+f;e&&(g+="&self_id="+e);this.Cg[a].nY||(setTimeout(function(){Qb(g,function(b){var d=c.Cg[a].aC;c.Cg[a].data=b;for(var e=0;e<d.length;e++)d[e](b);c.Cg[a].aC.length=0})},10),c.Cg[a].nY=o)}}});x.extend(Mc.prototype,{qa:function(a,b){Ec.prototype.qa.call(this,a,b);this.cr(a);this.pq();this.Zu()},remove:function(){var a=this.C;Ec.prototype.remove.call(this);a.removeEventListener("zoomend",this.Xk);a.removeEventListener("moveend",this.Dk);a.removeEventListener("resize",this.Jk)},cr:function(a){this.C=a;this.IB=this.Pb;this.yc=this.C.K.devicePixelRatio;this.mn=0},pq:function(){var a=this,b=this.C;a.Xk=function(b){a.Zu(b)};a.Dk=function(b){a.Zu(b)};a.Jk=function(b){a.Zu(b)};b.addEventListener("zoomend", a.Xk);b.addEventListener("moveend",a.Dk);b.addEventListener("resize",a.Jk)},Zu:function(){var a=this.C,b=a.bb.xm(this.IB,"traffic",this.mn);this.Hm||(this.Hm=o,0<b.length&&(this.Ob=a.oa().k.Ob));for(var a=0,c=b.length;a<c;a++)this.sr(b[a][0],b[a][1],b[a][2])},sr:function(a,b,c){var d=this,e=d.map,f=e.Ja(),g=new H(f.lng,f.lat),i=e.fa(),k="_t"+parseInt(a+""+b+""+i).toString(36),e=this.N_+"&x="+a+"&y="+b+"&z="+i+"&fn=BMap."+k+"&t="+(new Date).getTime();c.Xe=q;z[k]=function(e){var f=d.map,n=f.Ja(),f= f.fa();n.mb(g)&&f==i&&e.content&&e.content.tf&&d.Qn(e.content.tf,c,a,b);delete z[k]};Qb(e,q)},Qn:function(a,b){var c=b.getContext("2d"),d=this.qe,e=this.lx,f=this.mx;1<this.yc&&!b.lg&&(c.scale(this.yc,this.yc),b.lg=o);b.HB||(b.HB=o,c.translate(this.mn/2,this.mn/2));for(var g=0,i=a.length;g<i;g++){var k=a[g],l=k[1],m=this.Db[k[3]],k=this.Db[k[4]],n=l[0]/10,u=l[1]/10;c.beginPath();c.moveTo(n,u);for(var v=2,w=l.length;v<w;v+=2)n+=l[v]/10,u+=l[v+1]/10,c.lineTo(n,u);c.strokeStyle=d(m[1]);c.lineWidth=m[2]; c.lineCap=e(m[3]);c.lineJoin=f(m[4]);c.stroke();c.strokeStyle=d(k[1]);c.lineWidth=k[2];c.lineCap=e(k[3]);c.lineJoin=f(k[4]);c.stroke()}b.Xe=o},qe:function(a){a>>>=0;return"rgba("+(a>>24&255)+","+(a>>16&255)+","+(a>>8&255)+","+(a&255)/256+")"},lx:function(a){return["butt","square","round"][a]},mx:function(a){return["miter","bevel","round"][a]}});x.extend(db.prototype,{ye:function(){this.qa(this.C,this.B)},qa:function(a,b){this.C=a;this.B=b;this.C&&this.B&&(this.cr(),this.AS(),this.pq(),this.Kq())},remove:function(){var a=this.C;this.B.removeChild(this.Wa);a.removeEventListener("zoomend",this.Xk);a.removeEventListener("moving",this.PM);a.removeEventListener("moveend",this.Dk);a.removeEventListener("resize",this.Jk)},cr:function(){var a=this.C,b=a.K.devicePixelRatio,c=a.oa().k.Ob,d=a.yb(),a=d.width,d=d.height;this.Yh={};this.Ob=c;this.yc=b; this.FE=a;this.EE=d;this.uC=a*b;this.tC=d*b},AS:function(){var a=this.C,b=this.B,c=document.createElement("canvas"),d=c.style;d.position="absolute";d.zIndex=5;d.left=-a.offsetX+"px";d.top=-a.offsetY+"px";d.width=this.FE+"px";d.height=this.EE+"px";c.setAttribute("width",this.uC);c.setAttribute("height",this.tC);b.appendChild(c);this.Wa=c;this.Ih=c.getContext("2d");a=this.yc;1<a&&!c.lg&&(this.Ih.scale(a,a),c.lg=o)},pq:function(){function a(){b.Wa.style.left=-c.offsetX+"px";b.Wa.style.top=-c.offsetY+ "px"}var b=this,c=b.C,d=b.yc;b.Xk=function(c){b.Wa.style.display=18>this.fa()?"none":"block";a();b.Kq(c)};b.PM=function(c){var d=(new Date).getTime();100>d-b.nM||(b.nM=d,a(),b.Kq(c))};b.Dk=function(c){a();b.Kq(c)};b.Jk=function(e){var f=c.yb(),g=f.width,f=f.height,i=g*d,k=f*d;b.Wa.style.width=g+"px";b.Wa.style.height=f+"px";b.Wa.setAttribute("width",i);b.Wa.setAttribute("height",k);b.FE=g;b.EE=f;b.uC=i;b.tC=k;a();b.Kq(e)};c.addEventListener("zoomend",b.Xk);c.addEventListener("moving",b.PM);c.addEventListener("moveend", b.Dk);c.addEventListener("resize",b.Jk)},Kq:function(a){var b=this.C,c=b.fa();if(!(18>c)){var d=b.bb.lL(),e=d[0],b=d[1],f=d[2],d=d[3],a=a?q:o,g;for(g in this.Yh)for(var i=e;i<f;i++)for(var k=b;k<d;k++)g==i+"_"+k+"_"+c&&(this.Yh[g].TH=o);for(g in this.Yh)this.Yh[g].TH?delete this.Yh[g].TH:(this.Yh[g]=p,delete this.Yh[g]);this.Ih.clearRect(0,0,this.uC,this.tC);for(i=e;i<f;i++)for(k=b;k<d;k++)(g=this.Yh[i+"_"+k+"_"+c])?this.Qn(g,i,k,c,a):this.sr(i,k,c,a)}},sr:function(a,b,c,d){var e=this,f=e.C,g=e.mV, i=(a+b)%g.length,k="x="+a+"&y="+b+"&z="+c,l=f.ba.replace(/^TANGRAM_/,"")+"building"+parseInt(a+""+b+""+c).toString(36),g=g[i]+"qt=hjpgvd&"+k+"&styles=pl&layers=bg&features=bd&f=mwebapp&v=001&udt=20130501&fn=BMap."+l,i=f.Ja(),m=new H(i.lng,i.lat),n=f.fa();z[l]=function(g){if(g=g.content){var i=f.Ja(),k=f.fa();if(!i.mb(m)||k!=n){delete z[l];return}if(g=window.aZ(g))e.Qn(g,a,b,c,d),e.Yh[a+"_"+b+"_"+c]=g}delete z[l]};Qb(g)},Qn:function(a,b,c,d,e){e&&this.k.ZK?this.eR(a,b,c,d):this.hH(a,b,c,d,1)},eR:function(a, b,c,d){var e=this;a.RP=new sb({Ic:50,duration:200,ua:function(f){e.hH(a,b,c,d,f)},finish:function(){a.RP=p}})},hH:function(a,b,c,d,e){var f=this.C,g=this.FE,i=this.EE,d=f.oa().Bc(d),f=f.lc,k=this.Ob,b=b*k-f.lng/d,c=(-1-c)*k+f.lat/d,d=this.Ih,f=a.length,k=0,l=window.Db;d.save();for(d.translate(b+g/2,c+i/2);k<f;k++){var m=a[k],n=l[m[3]];if(4==n[0]){var u=m[7];window.VectorDrawUtils.YC(d,m[1],6*(m[2]*n[3])*e,90*((b+(u[0]+u[2])/2)/(g/2)),90*((c+(u[1]+u[3])/2)/(i/2)),"rgba(212,205,197,1)","rgba(235,233,228,1)", "rgba(170,170,170,1)",1)}}d.restore()}}); ');