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.
2 lines
19 KiB
2 lines
19 KiB
3 months ago
|
/**/_jsload2&&_jsload2('poly', 'function Ig(a,b){ib.call(this);this.point=a;this.type=b;this.K={}}z.lang.wa(Ig,ib,"Vertex"); z.extend(Ig.prototype,{initialize:function(a){this.map=a;var b="",b=this.type?"BMap_vectex BMap_vectex_nodeT":"BMap_vectex BMap_vectex_node",c=this.rG=this.ba=document.createElement("div");c.className=b;a.Mf().$N.appendChild(c);this.Jz();return c},draw:function(){var a=this.map.Ve(this.point);this.rG.style.left=a.x-5+"px";this.rG.style.top=a.y-5+"px"},ua:function(a){a instanceof J&&(this.point=this.K.point=new J(a.lng,a.lat),this.draw())},ja:x("point"),Jz:function(){function a(a,b){b.pixel=b.mb=a.mb; b.point=b.point=a.point;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.ba&&!this.ba.zi){this.ba.zi=p;var c=this.map,e=this,f=0,g=0,i=0,k={x:0,y:0};this.Tr=function(a){oa(a);if(2!=a.button){e.dl=p;var k=c.Rb(e.point),o=b(a);f=o.x-k.x;g=o.y-k.y;i=eb();e.map.$.xu=e;z.V(document,"mousemove",e.Wi);z.V(document,"mouseup",e.Vi);z.V(document,"touchmove",e.Wi);z.V(document,"touchend",e.Vi);e.ba&&e.ba.setCapture&& e.ba.setCapture();e.ba.style.cursor=e.K.Gd;"touchstart"==a.type&&na(a)}};this.Wi=function(i){if(e.dl){i=b(i);k=i=new R(i.x-f,i.y-g);e.ez=i;var n=e.map.Ib(i),o={mb:i,point:n};e.ql=e.rl=0;if(20>=i.x||i.x>=e.map.width-20||50>=i.y||i.y>=e.map.height-10){if(20>=i.x?e.ql=8:i.x>=e.map.width-20&&(e.ql=-8),50>=i.y?e.rl=8:i.y>=e.map.height-10&&(e.rl=-8),!e.Ee)e.Ee=setInterval(function(){c.tg(e.ql,e.rl,{noAnimation:p});var a=c.Ib(e.ez);e.ua(a)},30)}else e.Ee&&(clearInterval(e.Ee),e.Ee=s),e.ua(n);e.Wk||(e.dispatchEvent(a(o, new Q("ondragstart"))),e.Wk=p);e.dispatchEvent(a(o,new Q("ondragging")))}};this.Vi=function(){e.ba&&e.ba.releaseCapture&&e.ba.releaseCapture();e.dl=t;e.map.$.xu=s;z.dd(document,"mousemove",e.Wi);z.dd(document,"mouseup",e.Vi);z.dd(document,"touchmove",e.Wi);z.dd(document,"touchend",e.Vi);f=g=0;e.Ee&&(clearInterval(e.Ee),e.Ee=s);if(100<=eb()-i&&(2<k.x||2<k.y))e.Wk=t,e.dispatchEvent(a({mb:e.map.Rb(e.ja()),point:e.ja()},new Q("ondragend"))),k.x=k.y=0;e.Bl();e.ba&&(e.ba.style.cursor=e.K.cf?"pointer":"")}; z.V(this.ba,"mousedown",this.Tr);z.V(this.ba,"touchstart",this.Tr)}}});z.extend(sc.prototype,{nP:function(a){return this.repeat?this.pP(a):this.oP(a)},pP:function(a){var b=this.repeat,c=[],e,f,g;if(this.LH){e=Math.floor(1/this.repeat)+1;for(f=0;f<e;f++)c.push(Jg(a,1-b*f,p))}else{g=a.Ji[a.Ji.length-1];e=Math.floor(g/b)+1;for(f=0;f<e;f++)c.push(Jg(a,g-f*b,t))}return c},oP:function(a){return[Jg(a,this.Nj,this.KH)]},hide:function(){if(this.Uc&&0<this.Uc.length)for(var a=this.Uc.length-1;0<=a;a--)this.Uc[a].aa()},show:function(){if(this.Uc&&0<this.Uc.length)for(var a=this.Uc.length- 1;0<=a;a--)this.Uc[a].show()}});function Jg(a,b,c){var e=a.na;if(c){if(0>=b)return{point:e[0],index:1};if(1<=b)return{point:e[e.length-1],index:e.length-1};c=a.MR*b;b=Kg(c,a.vl);a=(c-a.vl[b-1])/(a.vl[b]-a.vl[b-1])}else{c=b;b=a.Ji[a.Ji.length-1];if(0>=c)return{point:e[0],index:1};if(c>=b)return{point:e[e.length-1],index:e.length-1};b=Kg(c,a.Ji);a=(c-a.Ji[b-1])/(a.Ji[b]-a.Ji[b-1])}c=e[b-1];e=e[b];return{point:new J(c.lng+(e.lng-c.lng)*a,c.lat+(e.lat-c.lat)*a),index:b}} z.lc.indexOf=function(a,b,c){var e=a.length,c=c|0;for(0>c&&(c=Math.max(0,e+c));c<e;c++)if(c in a&&a[c]===b)return c;return-1};function Kg(a,b){var c=Lg(b.concat(a));return z.lc.indexOf(c,a)}function Lg(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=Lg(c),a=Lg(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)};z.extend(oc.prototype,{initialize:function(a){a&&this.Iu&&a.addEventListener("onmousemove",this.Iu);a=ib.prototype.initialize.call(this,a);this.K.ff===p&&(this.$j(),this.Fl());return a},uj:function(){this.ba=(this.kn=Mg.hs(this.map)).Yn()},Zc:x("ba"),fa:function(){function a(a,b){var c=a.srcElement||a.target,i=Eb(),k=a.pageX?a.pageX:a.clientX+i[1],i=a.pageY?a.pageY:a.clientY+i[0];if(a&&b&&k&&i&&c){var c=z.lang.Mc(c.ea).map,m=z.R.ja(c.Ya);b.mb=new R(k-
|