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.
pingAnQiYeWeb/public/modules/poly_he44xr.js

1 line
19 KiB

1 year ago
/**/_jsload2 && _jsload2('poly', 'function mh(a,b){kb.call(this);this.point=a;this.type=b;this.z={}}x.lang.ua(mh,kb,"Vertex"); x.extend(mh.prototype,{initialize:function(a){this.map=a;var b="";this.point=$a(this.point,this.map);var b=this.type?"BMap_vectex BMap_vectex_nodeT":"BMap_vectex BMap_vectex_node",c=this.QH=this.V=document.createElement("div");c.className=b;a.Rf().EP.appendChild(c);this.aB();return c},draw:function(){var a=this.map.We(this.point);this.QH.style.left=a.x-5+"px";this.QH.style.top=a.y-5+"px"},ta:function(a){if(a instanceof O||a instanceof K)this.point=this.z.point=$a(a,this.map),this.draw()},po:v("point"), ia:function(){return hb(this.point,this.map)},aB:function(){function a(a,b){b.pixel=b.Wa=a.Wa;b.point=b.point=a.point;b.pointN=b.Cg=a.Cg;return b}function b(a){var b=a.clientX,c=a.clientY;a.changedTouches&&(b=a.changedTouches[0].clientX,c=a.changedTouches[0].clientY);return new R(b,c)}if(this.V&&!this.V.Pi){this.V.Pi=o;var c=this.map,d=this,e=0,f=0,g=0,i={x:0,y:0};this.Zs=function(a){pa(a);if(2!=a.button){d.Bl=o;var i=c.Cc(d.point),m=b(a);e=m.x-i.x;f=m.y-i.y;g=db();d.map.R.zv=d;x.M(document,"mousemove", d.mj);x.M(document,"mouseup",d.lj);x.M(document,"touchmove",d.mj);x.M(document,"touchend",d.lj);d.V&&d.V.setCapture&&d.V.setCapture();d.V.style.cursor=d.z.Id;"touchstart"==a.type&&oa(a)}};this.mj=function(g){if(d.Bl){g=b(g);i=g=new R(g.x-e,g.y-f);d.AA=g;var l=d.map.Bg(g),m=d.map.Rb(g),m={Wa:g,point:l,Cg:m};d.Pl=d.Ql=0;if(20>=g.x||g.x>=d.map.width-20||50>=g.y||g.y>=d.map.height-10){if(20>=g.x?d.Pl=8:g.x>=d.map.width-20&&(d.Pl=-8),50>=g.y?d.Ql=8:g.y>=d.map.height-10&&(d.Ql=-8),!d.He)d.He=setInterval(function(){c.Ag(d.Pl, d.Ql,{noAnimation:o});var a=c.Rb(d.AA);d.ta(a)},30)}else d.He&&(clearInterval(d.He),d.He=p),d.ta(l);d.tl||(d.dispatchEvent(a(m,new N("ondragstart"))),d.tl=o);d.dispatchEvent(a(m,new N("ondragging")))}};this.lj=function(){d.V&&d.V.releaseCapture&&d.V.releaseCapture();d.Bl=q;d.map.R.zv=p;x.cd(document,"mousemove",d.mj);x.cd(document,"mouseup",d.lj);x.cd(document,"touchmove",d.mj);x.cd(document,"touchend",d.lj);e=f=0;d.He&&(clearInterval(d.He),d.He=p);if(100<=db()-g&&(2<i.x||2<i.y))d.tl=q,d.dispatchEvent(a({Wa:d.map.Zp(d.ia()), point:d.ia(),Cg:d.po()},new N("ondragend"))),i.x=i.y=0;d.bm();d.V&&(d.V.style.cursor=d.z.jf?"pointer":"")};x.M(this.V,"mousedown",this.Zs);x.M(this.V,"touchstart",this.Zs)}}});x.extend(sd.prototype,{aR:function(a){return this.repeat?this.cR(a):this.bR(a)},cR:function(a){var b=this.repeat,c=[],d,e,f;if(this.qJ){d=Math.floor(1/this.repeat)+1;for(e=0;e<d;e++)c.push(nh(a,1-b*e,o))}else{f=a.$i[a.$i.length-1];d=Math.floor(f/b)+1;for(e=0;e<d;e++)c.push(nh(a,f-e*b,q))}return c},bR:function(a){return[nh(a,this.hk,this.pJ)]},hide:function(){if(this.jd&&0<this.jd.length)for(var a=this.jd.length-1;0<=a;a--)this.jd[a].U()},show:function(){if(this.jd&&0<this.jd.length)for(var a=this.jd.length- 1;0<=a;a--)this.jd[a].show()}});function nh(a,b,c){var d=a.ha;if(c){if(0>=b)return{point:d[0],index:1};if(1<=b)return{point:d[d.length-1],index:d.length-1};c=a.DT*b;b=oh(c,a.Wl);a=(c-a.Wl[b-1])/(a.Wl[b]-a.Wl[b-1])}else{c=b;b=a.$i[a.$i.length-1];if(0>=c)return{point:d[0],index:1};if(c>=b)return{point:d[d.length-1],index:d.length-1};b=oh(c,a.$i);a=(c-a.$i[b-1])/(a.$i[b]-a.$i[b-1])}c=d[b-1];d=d[b];return{point:new K(c.lng+(d.lng-c.lng)*a,c.lat+(d.lat-c.lat)*a),index:b}} x.kc.indexOf=function(a,b,c){var d=a.length,c=c|0;for(0>c&&(c=Math.max(0,d+c));c<d;c++)if(c in a&&a[c]===b)return c;return-1};function oh(a,b){var c=ph(b.concat(a));return x.kc.indexOf(c,a)}function ph(a){if(2>a.length)return a;for(var b=Math.floor(a.length/2),c=a.slice(0,b),a=a.slice(b),c=ph(c),a=ph(a),b=[];0<c.length&&0<a.length;)c[0]>a[0]?b.push(a.shift()):b.push(c.shift());return b.concat(c).concat(a)};x.extend(ld.prototype,{initialize:function(a){a&&this.Jv&&a.addEventListener("onmousemove",this.Jv);a=kb.prototype.initialize.call(this,a);this.z.mf===o&&(this.uk(),this.gm());return a},Pj:function(){this.V=(this.lo=qh.ot(this.map)).To()},ca:function(){function a(a,b){var c=a.srcElement||a.target,g=Hb(),i=a.pageX?a.pageX:a