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
16 KiB
1 line
16 KiB
1 year ago
|
/**/_jsload2 && _jsload2('newvectordrawlib', 'function Jg(a){this.JI=o;this.k=x.object.extend(a||{},{Gh:o});Hd.call(this,this.k);this.Dg={};this.loaded=q;this.du=p;this.CC=q}Jg.prototype=new Hd; Jg.prototype.ra=function(a){if(!this.loaded){this.loaded=o;var b=this;b.map=a;b.fb=b.map.fb;b.map=a;this.xb=this.map.oa();this.Ob=this.xb.k.Ob;this.Ac=this.map.B.devicePixelRatio;b.Ax=q;b.eL=p;b.Se=b.k.style||"normal";b.En=b.k.styleStr||p;b.Dq=200;b.De=p;b.de=0;b.zb=this.fb.fo(0);b.fb.nd.appendChild(this.zb);b.fb.zb=b.zb;b.Ib=new B.NewVectorDrawLib(a);b.Ib.Ob=this.xb.k.Ob;b.Is="";b.Ib.RC=b.Se;b.nm();b.Se&&"normal"!==b.Se||b.En&&0<b.En.length?b.mu(b.Se,b.En,function(){b.map.addEventListener("click", function(a){b.de++;if(1===b.de)b.De=setTimeout(function(){b.Qu(a);b.de=0},b.Dq);else return clearTimeout(b.De),b.de=0,q});b.zb.innerHTML="";b.ee(o)}):(b.ee(),b.map.addEventListener("click",function(a){b.de++;if(1===b.de)a.cb||(b.De=setTimeout(function(){b.Qu(a);b.de=0},b.Dq));else return clearTimeout(b.De),b.de=0,q}));b.map.B.pj&&(J()&&b.Hf==k)&&(b.Hf=new B.bH(b.map),b.map.Ka(b.Hf))}}; x.extend(Jg.prototype,{nm:function(){var a=this;setTimeout(function(){a.map.addEventListener("moveend",function(b){"centerAndZoom"!=b.TH&&a.ee()});a.map.addEventListener("zoomend",function(){a.Ax=q;a.ee()});a.map.addEventListener("onresize",function(){a.ee()});Xa()&&(a.map.addEventListener("onmoving",function(){a.ee()}),a.map.addEventListener("onmaptypechange",function(){a.ee()}));a.map.addEventListener("mousemove",function(b){a.map.Wb()&&a.iD(b)})},1);a.map.addEventListener("setcustomstyles",function(b){a.SC(b.target)})}, mu:function(a,b,c){if(this.map.Wb()){var d=this,e=B.jc+"custom/",f;b&&0<b.length?(f="setStyle_"+b.length,e+="mapstyle?styles="+encodeURIComponent(b)):(f="setStyle_"+a,e+="getstyle?customid="+a);f+=this.map.ba;window[f]=function(b,e){var j=x.extend({},d.Ib.Yz);d.Ib.Eb=x.extend(j,b);j=B.Cb.we(d.Ib.Eb["3181"][1]);d.map.B.Wo=j;d.map.Ga().style.backgroundColor=j;c(a);d.map.dispatchEvent(new N("onsetmapstylesuccess",e));delete window[f]};sa(e+("&callback="+f+"&udt=20150526"),q)}},kq:function(a){var b=this; b.mu(a.style,a.styleStr,function(a){b.Se=a;b.Ib.RC=b.Se;var a=b.Ib.jt,d;for(d in a)delete a[d];b.GF()})},ee:function(){this.map.ga();this.map.Wb()?(this.zb.style.display="block",this.Ib.$s(this.Rm())):(this.zb.style.display="none",this.zb.innerHTML="")},Rm:function(){var a=this.map,b=this.xb,c=a.ga(),d=a.dc,e=b.yc(c),f=b.GE(c),b=a.ba.replace(/^TANGRAM_/,""),g=Math.ceil(d.lng/f);column=Math.ceil(d.lat/f);var i=this.Ob,j=[g,column,(d.lng-g*f)/f*i,(d.lat-column*f)/f*i],f=j[0]-Math.ceil((a.width/2-j[2])/ i),l=j[1]-Math.ceil((a.height/2-j[3])/i),m=j[0]+Math.ceil((a.width/2+j[2])/i),n=j[1]+Math.ceil((a.height/2+j[3])/i);for(this.Rc?this.Rc.length=0:this.Rc=[];f<m;f++)for(g=l;g<n;g++)this.Rc.push([f,g]);this.Rc.sort(function(a){return function(b,c){return 0.4*Math.abs(b[0]-a[0])+0.6*Math.abs(b[1]-a[1])-(0.4*Math.abs(c[0]-a[0])+0.6*Math.abs(c[1]-a[1]))}}([j[0]-1,j[1]-1]));d=[Math.round(-d.lng/e),Math.round(d.lat/e)];f=-a.offsetY+a.height/2;e=this.zb;e.style.left=-a.offsetX+a.width/2+"px";e.style.top= f+"px";this.Oe?this.Oe.length=0:this.Oe=[];f=0;for(a=e.childNodes.length;f<a;f++)g=e.childNodes[f],g.Hr=q,this.Oe.push(g);if(f=this.hn)for(var s in f)delete f[s];else this.hn={};this.Pe?this.Pe.length=0:this.Pe=[];f=0;for(a=this.Rc.length;f<a;f++){s=this.Rc[f][0];j=this.Rc[f][1];g=0;for(l=this.Oe.length;g<l;g++)if(m=this.Oe[g],m.id==b+"_"+s+"_"+j+"_"+c){m.Hr=o;this.hn[m.id]=m;break}}f=0;for(a=this.Oe.length;f<a;f++)m=this.Oe[f],m.Hr||(m.be=p,delete m.be,this.Pe.push(m));this.Gn=[];g=i*this.Ac;f=0; for(a=this.Rc.length;f<a;f++)s=this.Rc[f][0],j=this.Rc[f][1],l=s*i+d[0],m=(-1-j)*i+d[1],n=b+"_"+s+"_"+j+"_"+c,cvs=this.hn[n],cvsStyle=p,cvs?(cvsStyle=cvs.style,cvsStyle.left=l+"px",cvsStyle.top=m+"px",cvs.af||(cvs.be=p,delete cvs.be,this.Gn.push([s,j,cvs]))):(0<this.Pe.length?(cvs=this.Pe.shift(),cvs.getContext("2d").clearRect(0,0,g,g),cvsStyle=cvs.style):(cvs=document.createElement("canvas"),cvsStyle=cvs.style,cvsStyle.position="absolute",cvsStyle.backgrou
|