Files
hb_pqs_web/public/static/map/modules/poly_3npbm5.js
2025-01-09 19:02:44 +08:00

2 lines
19 KiB
JavaScript

/**/_jsload2&&_jsload2('poly', 'function gh(a,b){ib.call(this);this.point=a;this.type=b;this.z={}}x.lang.ua(gh,ib,"Vertex"); x.extend(gh.prototype,{initialize:function(a){this.map=a;var b="";this.point=Za(this.point,this.map);var b=this.type?"BMap_vectex BMap_vectex_nodeT":"BMap_vectex BMap_vectex_node",c=this.BH=this.V=document.createElement("div");c.className=b;a.Rf().nP.appendChild(c);this.OA();return c},draw:function(){var a=this.map.We(this.point);this.BH.style.left=a.x-5+"px";this.BH.style.top=a.y-5+"px"},ta:function(a){if(a instanceof O||a instanceof K)this.point=this.z.point=Za(a,this.map),this.draw()},eo:v("point"), ia:function(){return fb(this.point,this.map)},OA:function(){function a(a,b){b.pixel=b.Wa=a.Wa;b.point=b.point=a.point;b.pointN=b.Bg=a.Bg;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.Ns=function(a){oa(a);if(2!=a.button){d.vl=o;var i=c.Cc(d.point),m=b(a);e=m.x-i.x;f=m.y-i.y;g=cb();d.map.R.nv=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&&na(a)}};this.mj=function(g){if(d.vl){g=b(g);i=g=new R(g.x-e,g.y-f);d.nA=g;var l=d.map.Ag(g),m=d.map.Rb(g),m={Wa:g,point:l,Bg:m};d.Jl=d.Kl=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.Jl=8:g.x>=d.map.width-20&&(d.Jl=-8),50>=g.y?d.Kl=8:g.y>=d.map.height-10&&(d.Kl=-8),!d.He)d.He=setInterval(function(){c.zg(d.Jl, d.Kl,{noAnimation:o});var a=c.Rb(d.nA);d.ta(a)},30)}else d.He&&(clearInterval(d.He),d.He=p),d.ta(l);d.nl||(d.dispatchEvent(a(m,new N("ondragstart"))),d.nl=o);d.dispatchEvent(a(m,new N("ondragging")))}};this.lj=function(){d.V&&d.V.releaseCapture&&d.V.releaseCapture();d.vl=q;d.map.R.nv=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<=cb()-g&&(2<i.x||2<i.y))d.nl=q,d.dispatchEvent(a({Wa:d.map.Mp(d.ia()), point:d.ia(),Bg:d.eo()},new N("ondragend"))),i.x=i.y=0;d.Wl();d.V&&(d.V.style.cursor=d.z.jf?"pointer":"")};x.M(this.V,"mousedown",this.Ns);x.M(this.V,"touchstart",this.Ns)}}});x.extend(ld.prototype,{IQ:function(a){return this.repeat?this.KQ(a):this.JQ(a)},KQ:function(a){var b=this.repeat,c=[],d,e,f;if(this.bJ){d=Math.floor(1/this.repeat)+1;for(e=0;e<d;e++)c.push(hh(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(hh(a,f-e*b,q))}return c},JQ:function(a){return[hh(a,this.gk,this.aJ)]},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 hh(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.kT*b;b=ih(c,a.Ql);a=(c-a.Ql[b-1])/(a.Ql[b]-a.Ql[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=ih(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.jc.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 ih(a,b){var c=jh(b.concat(a));return x.jc.indexOf(c,a)}function jh(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=jh(c),a=jh(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(hd.prototype,{initialize:function(a){a&&this.xv&&a.addEventListener("onmousemove",this.xv);a=ib.prototype.initialize.call(this,a);this.z.mf===o&&(this.tk(),this.am());return a},Oj:function(){this.V=(this.$n=kh.bt(this.map)).Ho()},ca:function(){function a(a,b){var c=a.srcElement||a.target,g=Fb(),i=a.pageX?a.pageX:a.clientX+g[1],g=a.pageY?a.pageY:a.clientY+g[0];if(a&&b&&i&&g&&c){var c=x.lang.Lc(c.ba).map,k=x.K.ia(c.Ua);b.Wa=new R(i-k.left,g-k.top);b.point=c.Ag(b.Wa);b.pixel=b.Wa;b.point=b.point; b.pointN=c.Rb(b.Wa)}return b}var b=this.V,c=this;"canvas"!==kh.bt(this.map).pp()&&!J()&&(c.z.jf&&(b.style.cursor="pointer",x.M(b,"click",function(b){c.II&&c.II.ab(c.map.wc())&&c.dispatchEvent(a(b,ma(new N("onclick"),b)))}),x.M(b,"dblclick",function(b){c.dispatchEvent(a(b,ma(new N("ondblclick"),b)))}),(!x.da.Te||4>x.da.Te)&&x.M(this.V,"contextmenu",function(b){c.dispatchEvent(a(b,ma(new N("onrightclick"),b)))})),x.M(b,"mousedown",function(b){c.dispatchEvent(a(b,ma(new N("onmousedown"),b)));c.II=c.map.wc()}), x.M(b,"mouseup",function(b){c.dispatchEvent(a(b,ma(new N("onmouseup"),b)))}),x.M(this.V,"mouseup",function(b){c.dispatchEvent(a(b,ma(new N("onmouseup"),b)));x.da.Te>=4&&(b.button===2&&c.z.jf)&&c.dispatchEvent(a(b,ma(new N("onrightclick"),b)))}));b=p;this.Pi||(this.Pi=o,this.xv=function(a){if(c.map&&!c.map.R.nv){var b=c.IS(a.point),f=parseFloat(b.Ca),g;if(f<c.z.lN){g=c.Qa.gy?new N("onmousemove"):new N("onmouseover");c.Qa.HM=q;c.Qa.gy=o}else if(!c.Qa.HM&&c.Qa.gy){g=new N("onmouseout");c.Qa.gy=q;c.Qa.HM= o}if(g){if(!(c instanceof zd)&&g.type==="onmousemove"&&c.Qa.gy===o&&(f===0||f>c.z.lN)){g.pixel=g.Wa=a.Wa;g.point=g.point=a.point;g.pointN=g.Bg=Za(a.point,c.map)}else{g.point=g.point=this.IN(b.Wa);g.pointN=g.Bg=this.KT(b.Wa);g.pixel=g.Wa=this.Mp(g.point)}c.dispatchEvent(g)}}},this.map.addEventListener("onmousemove",this.xv),this.addEventListener("mouseover",t()),this.addEventListener("mouseout",t()))},draw:function(a){this.V&&this.$n&&("canvas"===this.$n.Lb&&this.Yv?(this.Yv(),this.$n.me(this.V,this.kr(this.ha), this.z)):this.$n.me(this.V,this.kr(this.ha)),this instanceof zd&&this.z.ti&&this.LR(a))},Ab:function(){this.map&&(this.initialize(this.map),this.V.style.WebkitUserSelect="none",this.draw())},kr:function(a){var b=this.map,c=[],d=b.Kd(),e=this.Kd();if(!d.At(e)||0===a.length||!this.V||!this.oh())return[c];this.z.mf||(d=this.Fm(b.ga()),this.gf[d]?a=this.gf[d]:(a=lh(a,this.Dk(b.ga())),a=this.gf[d]=a));d=this.z.t0;c.push(b.We(a[0],p,d));for(var f=e=1,g=a.length;e<g;e++){var i=b.We(a[e],p,d);i.ab(c[f-1])|| (c.push(i),f++)}return[c]},Fm:function(a){return this.z.Fm?this.z.Fm(a):6>a?0:10>a?1:15>a?2:3},Dk:function(a){return this.z.Dk?this.z.Dk(a):hd.iF[this.Fm(a)]},Wr:function(a){this.gf.length=0;a=hd.Cx(a);this.Bo=a.slice(0,a.length-1);this.ha=a.slice(0);this.Ih();this.draw();this.dispatchEvent(new N("onlineupdate"))},me:function(a){this.Wr(a);this.z.mf===o&&(this.tk(),this.am())},vn:function(a,b){b&&this.ha[a]&&(this.gf.length=0,this.ha[a]=new O(b.lng,b.lat),this.Ih(),this.z.mf===o&&(this.tk(),this.am()), this.draw(),this.dispatchEvent(new N("onlineupdate")))},setStrokeColor:function(a){this.z&&(this.z.strokeColor=a);this.Sl("strokecolor",a)},bq:function(a){0<a&&(this.z.lc=a,this.Sl("strokeweight",a),"dashed"===this.XL()&&(this.map&&"svg"===kh.bt(this.map).pp())&&this.Sl("strokestyle","dashed"))},$p:function(a){a===j||(1<a||0>a)||(this.z.td=a,this.map&&this.Sl("strokeopacity",a))},bu:function(a){1<a||0>a||(this.z.sg=a,this.Sl("fillopacity",a))},aq:function(a){"solid"!==a&&"dashed"!==a||(this.z.strokeStyle= a,this.Sl("strokestyle",a))},setFillColor:function(a){this.z.fillColor=a||"";this.Sl("fillcolor",a)},Sl:function(a,b){this.$n&&(this.$n.setAttribute(this.V,a,b||"",this.YL()),this.dispatchEvent(new N("onlineupdate")))},am:function(){var a=this;if(!a.mc.length)for(var b=this.cM(),c=function(b){a.Nv(b)},d=t(),e=function(b){a.qB(b)},f=0,g=b.length;f<g;f++){var i=b[f],k=new gh(i.yb,i.qa);k.addEventListener("ondragging",c);k.addEventListener("ondragstart",d);k.addEventListener("ondragend",e);k.index=f; k.qa=i.qa;this.mc.push(k);this.map&&this.map.Ja(k)}},tk:function(){for(var a;a=this.mc.pop();)this.map.Ub(a);this.mc.length=0},cM:function(){for(var a=[],b=0,c=this.ha.length;b<c;b++){var d=this.ha[b];a.push({yb:d,qa:0});if(b<c-1){var e=this.ha[b+1],d=new O((d.lng+e.lng)/2,(d.lat+e.lat)/2);a.push({yb:d,qa:1})}}return this.Sc=a},z1:t(),qB:function(a){this.Qa.kj&&(this.map.Ub(this.Qa.kj),delete this.Qa.kj);this.Qa.Ci&&(this.map.Ub(this.Qa.Ci),delete this.Qa.Ci);this.Qa.yi&&(this.map.Ub(this.Qa.yi), delete this.Qa.yi);var b=a.Bg,a=a.currentTarget.index,c;if(0!==a%2){this.iA(a);this.Eq(a,b,0);var d=Za(this.Sc[a-1].yb,this.map);c=Za(this.Sc[a+1].yb,this.map);d=this.Zs(d,b);c=this.Zs(b,c);this.Eq(a,d,1);this.Eq(a+2,c,1);a=Math.ceil(a/2);c=this.ha.slice();a=c.splice(a,this.ha.length-a);c[c.length]=fb(b,this.map);c=c.concat(a)}else this.Sc[a].yb=b,0<=a-2&&(d=Za(this.Sc[a-2].yb,this.map),d=this.Zs(d,b),this.mc[a-1].show(),this.mc[a-1].ta(d)),a+2<this.Sc.length&&(c=Za(this.Sc[a+2].yb,this.map),c=this.Zs(b, c),this.mc[a+1].show(),this.mc[a+1].ta(c)),this instanceof yd&&this.Sc.length-1===a&&(this.iA(0),this.Eq(0,b,0),this.iA(1),this.Eq(1,this.Zs(Za(this.Sc[0].yb,this.map),Za(this.Sc[1].yb,this.map)),1),this.mc[0].V.style.zIndex="-10000000"),a/=2,this.ha.splice(a,1,fb(b,this.map)),this instanceof yd&&this.ha.length-1===a&&this.ha.splice(0,1,fb(b,this.map)),c=this.ha;b=0;for(a=this.mc.length;b<a;b++)this.mc[b].index=b;this.ha=c;this.Wr(c)},Eq:function(a,b,c){var d=this;this.Sc.splice(a,0,{yb:b,qa:c}); b=new gh(b,c);b.addEventListener("ondragging",function(a){d.Nv(a)});b.addEventListener("ondragstart",t());b.addEventListener("ondragend",function(a){d.qB(a)});b.index=a;b.qa=c;this.mc.splice(a,0,b);this.map.Ja(b)},iA:function(a){this.map.Ub(this.mc[a]);this.Sc.splice(a,1);this.mc.splice(a,1)},Zs:function(a,b){return new K((a.lng+b.lng)/2,(a.lat+b.lat)/2)},IS:function(a){var b,c,d,e,f,g,i=[],k=this.map.We(a),i=this.kr(this.ha)[0],l=i.length;if(1<l){for(e=1;e<l;e++){var m=i[e-1],n=i[e];if(m&&n){m.x!== n.x?(f=(n.y-m.y)/(n.x-m.x),f=Math.abs(f*k.x+(n.y-f*n.x)-k.y)/Math.sqrt(f*f+1)):f=Math.abs(k.x-n.x);var s=Math.pow(n.y-m.y,2)+Math.pow(n.x-m.x,2),n=Math.pow(n.y-k.y,2)+Math.pow(n.x-k.x,2),m=Math.pow(m.y-k.y,2)+Math.pow(m.x-k.x,2),u=Math.pow(f,2);n-u+m-u>s&&(f=Math.sqrt(Math.min(n,m)));if(b==p||b>f)c=Math.sqrt(m-u)/Math.sqrt(s),d=Math.sqrt(n-u)/Math.sqrt(s),b=f,g=e;b=Math.min(b,f)}}if(!(this instanceof zd)){f=k=0;s=this.ha;for(e=0;e<l;e++)k=e===l-1?0:k+1,s[e].lat!==s[k].lat&&((a.lat>=s[e].lat&&a.lat< s[k].lat||a.lat>=s[k].lat&&a.lat<s[e].lat)&&a.lng<(s[k].lng-s[e].lng)*(a.lat-s[e].lat)/(s[k].lat-s[e].lat)+s[e].lng)&&f++;b=Math.min(b,0<f%2?0:b)}1<c&&(c=1);1<d&&(c=0);a=i[g-1].y-i[g].y;e=i[g-1].x-(i[g-1].x-i[g].x)*c;f=i[g-1].y-a*c}return{Wa:new R(e,f),Ca:b}},show:function(){ib.prototype.show.call(this);this.draw();this.z.mf===o&&this.am()},U:function(){ib.prototype.U.call(this);this.z.mf===o&&this.tk()},remove:function(){fd.prototype.remove.call(this);this.z.mf===o&&this.tk()}}); function mh(a,b){var c={top:0,bottom:0,right:0,left:0,all:0},d=a.x,e=a.y;e<b.jN?(c.top=8,c.all+=c.top):e>b.fN&&(c.bottom=4,c.all+=c.bottom);d>b.eN?(c.right=2,c.all+=c.right):d<b.iN&&(c.left=1,c.all+=c.left);return c} function lh(a,b){if(1>=a.length)return a;var c=a,d=b!==j?b*b:1,e=c.length,f=new ("undefined"!==typeof Uint8Array?Uint8Array:Array)(e),g=0,i=e-1,k=[],l=[],m,n,s,u;for(f[g]=f[i]=1;i;){n=0;for(m=g+1;m<i;m++){s=c[m];var w=c[g],y=c[i],D=w.lng,w=w.lat,C=y.lng-D,F=y.lat-w;if(0!==C||0!==F){var z=((s.lng-D)*C+(s.lat-w)*F)/(C*C+F*F);1<z?(D=y.lng,w=y.lat):0<z&&(D+=C*z,w+=F*z)}C=s.lng-D;F=s.lat-w;s=C*C+F*F;s>n&&(u=m,n=s)}n>d&&(f[u]=1,k.push(g,u,u,i));i=k.pop();g=k.pop()}for(m=0;m<e;m++)f[m]&&l.push(c[m]);return l} U($f,{show:$f.show,hide:$f.U,remove:$f.remove,setPath:$f.me,setPositionAt:$f.vn,setStrokeColor:$f.setStrokeColor,setStrokeWeight:$f.bq,setStrokeOpacity:$f.$p,setFillOpacity:$f.bu,setStrokeStyle:$f.aq,setFillColor:$f.setFillColor});x.extend(zd.prototype,{initialize:function(a){hd.prototype.initialize.call(this,a);this.mJ=[0];this.Ur=[0];this.Ql=[0];for(var a=1,b=this.ha,c=b.length;a<c;a++){this.mJ[a]=T.fp(b[a],b[a-1]);var d=T.tb(b[a-1]),e=T.tb(b[a]);this.Ur[a]=90-180*Math.atan2(e.lat-d.lat,e.lng-d.lng)/Math.PI;this.Ql[a]=this.Ql[a-1]+this.mJ[a]}this.kT=this.Ql[c-1];this.Yv();this.Xv={};return this.V},Yv:function(){this.setFillColor("");this.setStrokeColor(this.z.strokeColor);this.bq(this.z.lc);this.aq(this.z.strokeStyle);this.$p(this.z.td)}, kr:function(a){var b=this.map,c=[],d=b.Kd(),e=this.Kd();if(!d.At(e)||0==a.length||!this.V||!this.oh())return[c];!(J()&&5E3<a.length)&&!this.z.mf&&(d=this.Fm(b.ga()),this.gf[d]?a=this.gf[d]:(e=lh(a,this.Dk(b.ga())),a=this.gf[d]=e));c.push(b.We(a[0]));for(var f=d=1,e=a.length;d<e;d++){var g=b.We(a[d]);g.ab(c[f-1])||(c.push(g),f++)}a=[];d=b.offsetX;e=b.offsetY;f=b.B.px;b={iN:-d-f,jN:-e-f,eN:-d+f+b.width,fN:-e+f+b.height};d=0;for(e=c.length-1;d<e;d++){var i=c[d],k=c[d+1],f=b,l=g=q,m=q,i=new R(i.x,i.y), k=new R(k.x,k.y),n=mh(i,f),s=mh(k,f),u=j,w=j,y=j,D=f.iN,C=f.jN,F=f.eN,z=f.fN;do 0===n.all&&0===s.all?m=g=o:0!==(n.all&s.all)?m=o:(u=0!==n.all?n:s,u.top?(w=i.x+(k.x-i.x)*(C-i.y)/(k.y-i.y),y=C):u.bottom?(w=i.x+(k.x-i.x)*(z-i.y)/(k.y-i.y),y=z):u.right?(y=i.y+(k.y-i.y)*(F-i.x)/(k.x-i.x),w=F):u.left&&(y=i.y+(k.y-i.y)*(D-i.x)/(k.x-i.x),w=D),l=o,u.all===n.all)?(i.x=Math.round(w),i.y=Math.round(y),n=mh(i,f)):(k.x=Math.round(w),k.y=Math.round(y),s=mh(k,f));while(!m);f=g?{ON:new R(i.x,i.y),PN:new R(k.x,k.y), clip:l?o:q}:j;f&&a.push(f)}c=[[]];d=0;for(e=a.length;d<e;d++)a[d].clip?(c[c.length-1].push(a[d].ON),c[c.length-1].push(a[d].PN),a[d+1]&&a[d+1].clip&&c.push([])):(c[c.length-1].push(a[d].ON),d==a.length-1&&c[c.length-1].push(a[d].PN));return c},hide:function(){hd.prototype.U.call(this);if(this.z.ti&&0<this.z.ti.length)for(var a=0,b=this.z.ti.length;a<b;a++)this.z.ti[a].hide()},show:function(){hd.prototype.show.call(this);if(this.z.ti&&0<this.z.ti.length)for(var a=0,b=this.z.ti.length;a<b;a++)this.z.ti[a].show()}, LR:function(a){var b=this.Hx(),c=b.ga(),d=b.Kd();icons=this.z.ti;displayPixels=hd.prototype.kr.call(this,this.ha);if(this.Xv[c]&&0<this.Xv[c].length)this.$i=this.Xv[c];else{for(var e=[0],f=1,g=displayPixels[0],i=g.length;f<i;f++)e[f]=e[f-1]+Gb(g[f],g[f-1]);this.$i=this.Xv[c]=e}for(f=0;f<icons.length;f++){var e=icons[f],g=e.U_,k,l,m;e.Rv[c]&&0<e.Rv[c].length?m=e.Rv[c]:e.Rv[c]=m=e.IQ(this);if(1===m.length)d.Zw(m[0].point)&&(e.jd[0]&&(b.Ub(e.jd[0]),e.jd[0].remove()),e.vL||(7===g.Lb||5===g.Lb?g.setRotation&& g.setRotation(-180+this.Ur[m[0].index]):g.setRotation&&g.setRotation(this.Ur[m[0].index])),e.jd[0]=new W(m[0].point,{icon:g}),b.Ja(e.jd[0]));else if(1<m.length){i={};if(a&&"onzoomend"===a.type)for(var n in e.jd)b.Ub(e.jd[n]),e.jd[n].remove();else x.jc.Fb(e.jd,function(a){b.Ub(a);a.remove()});e.jd=[];for(n=0;n<m.length;n++){l=m[n].index;k=m[n].point;var s=""+k.lat+(""+k.lng);d.Zw(k)&&!i[s]&&(e.vL||(7===g.Lb||5===g.Lb?g.setRotation&&g.setRotation(-180+this.Ur[l]):g.setRotation&&g.setRotation(this.Ur[l])), k=new W(k,{icon:g}),e.jd.push(k),b.Ja(k))}}}},Nv:function(a){var b=a.currentTarget,c=a.Bg,d=b.index,e=this.Sc,f,g=a=p;if(0==d){var i=Za(e[d+2].yb,this.map);f=[c,i];a=new K((i.lng+c.lng)/2,(i.lat+c.lat)/2);this.mc[d+1]&&this.mc[d+1].U()}else if(d==e.length-1){var k=Za(e[d-2].yb,this.map);f=[k,c];a=new K((k.lng+c.lng)/2,(k.lat+c.lat)/2);this.mc[d-1]&&this.mc[d-1].U()}else k=e[d-1].yb,i=e[d+1].yb,f=[k,c,i],b.qa||(k=Za(e[d-2].yb,this.map),i=Za(e[d+2].yb,this.map),f=[k,c,i],a=new K((k.lng+c.lng)/2,(k.lat+ c.lat)/2),g=new K((i.lng+c.lng)/2,(i.lat+c.lat)/2),this.mc[d-1]&&this.mc[d-1].U(),this.mc[d+1]&&this.mc[d+1].U());this.Qa.kj?(this.Qa.kj.me(f),this.Qa.kj.show()):(b=new zd(f,{strokeStyle:"dashed",strokeColor:this.z.strokeColor,lc:this.z.lc,td:this.z.td}),this.map.Ja(b),b.U(),this.Qa.kj=b);!this.Qa.Ci&&a?(this.Qa.Ci=new gh(a,1),this.map.Ja(this.Qa.Ci)):a&&this.Qa.Ci.ta(a);!this.Qa.yi&&g?(this.Qa.yi=new gh(g,1),this.map.Ja(this.Qa.yi)):g&&this.Qa.yi.ta(g)}}); x.jc.remove=function(a,b){for(var c=a.length;c--;)a[c]===b&&a.splice(c,1);return a};x.extend(yd.prototype,{initialize:function(a){hd.prototype.initialize.call(this,a);this.setStrokeColor(this.z.strokeColor);this.bq(this.z.lc);this.aq(this.z.strokeStyle);this.setFillColor(this.z.fillColor);this.$p(this.z.td);this.bu(this.z.sg);return this.V},vn:function(a,b){this.Bo[a]&&(this.gf.length=0,this.Bo[a]=new O(b.lng,b.lat),this.ha[a]=new O(b.lng,b.lat),0==a&&!this.ha[0].ab(this.ha[this.ha.length-1])&&(this.ha[this.ha.length-1]=new O(b.lng,b.lat)),this.Ih(),this.z.mf==o&&(this.tk(),this.am()), this.draw(),this.dispatchEvent(new N("onlineupdate")))},Yv:function(){this.setStrokeColor(this.z.strokeColor);this.bq(this.z.lc);this.aq(this.z.strokeStyle);this.setFillColor(this.z.fillColor);this.$p(this.z.td);this.bu(this.z.sg)},containPoint:function(a){var b=this.ha,c=q;if(a instanceof O||a instanceof O){if(this.Yu.Zw(a)){for(var d=a.lat,a=a.lng,e=0,f=b.length-1;e<b.length;f=e++){var g=b[e].lat,i=b[e].lng,k=b[f].lat,f=b[f].lng;i>a!=f>a&&d<(k-g)*(a-i)/(f-i)+g&&(c=!c)}return c}return q}},Nv:function(a){var b= a.currentTarget,c=a.point,d=b.index,e=this.Sc,f,g=a=p;if(0==d){var i=fb(e[e.length-2].yb,this.map),k=fb(e[d+2].yb,this.map);f=[i,c,k];b.qa||(a=new O((i.lng+c.lng)/2,(i.lat+c.lat)/2),g=new O((k.lng+c.lng)/2,(k.lat+c.lat)/2))}else d==e.length-1?(k=fb(e[2].yb,this.map),i=fb(e[d-2].yb,this.map),f=[i,c,k],b.qa||(a=new O((i.lng+c.lng)/2,(i.lat+c.lat)/2),g=new O((k.lng+c.lng)/2,(k.lat+c.lat)/2))):(i=fb(e[d-1].yb,this.map),k=fb(e[d+1].yb,this.map),f=[i,c,k],b.qa||(i=fb(e[d-2].yb,this.map),k=fb(e[d+2].yb, this.map),f=[i,c,k],a=new O((i.lng+c.lng)/2,(i.lat+c.lat)/2),g=new O((k.lng+c.lng)/2,(k.lat+c.lat)/2),this.mc[d-1]&&this.mc[d-1].U(),this.mc[d+1]&&this.mc[d+1].U()));this.Qa.kj?this.Qa.kj.me(f):(b=new zd(f,{strokeStyle:"dashed",strokeColor:this.z.strokeColor,lc:this.z.lc,td:this.z.td}),this.map.Ja(b),this.Qa.kj=b);!this.Qa.Ci&&a?(this.Qa.Ci=new gh(a,1),this.map.Ja(this.Qa.Ci)):a&&this.Qa.Ci.ta(a);!this.Qa.yi&&g?(this.Qa.yi=new gh(g,1),this.map.Ja(this.Qa.yi)):g&&this.Qa.yi.ta(g)}});U(cg,{setPositionAt:cg.vn});x.extend(Ad.prototype,{initialize:function(a){yd.prototype.initialize.call(this,a);this.ha=this.tv(this.point,this.xa);this.Ih();return this.V},Xf:function(a,b){a&&(this.gf.length=0,b||(this.Sc=p),this.point=a,this.ha=this.tv(a,this.xa),this.Ih(),this.draw(),this.dispatchEvent(new N("onlineupdate")))},wf:function(a,b){isNaN(a)||(this.gf.length=0,b||(this.Sc=p),this.xa=Math.abs(a),this.ha=this.tv(this.point,this.xa),this.Ih(),this.draw(),this.dispatchEvent(new N("onlineupdate")))},Dk:function(a){return this.z.Dk? this.z.Dk(a):Ad.iF[this.Fm(a)]},Nv:function(a){var b,a=a.currentTarget,c=this.Sc;b=c[0].yb;c=c[c.length-1].yb;0==a.index?(b=a.ia(),a=c):a=a.ia();this.wf(T.fp(Za(b,this.map),Za(a,this.map)),o);this.Xf(b,o)},qB:function(a){var a=a.currentTarget,b=a.index;this.Sc[0]={yb:this.point,qa:0};1==b&&(this.Sc[1]={yb:a.point,qa:0});this.tk();this.am()},cM:function(){if(!this.Sc){var a=[];a.push({yb:this.point,qa:0});a.push({yb:this.ha[Math.floor(3*this.ha.length/4)],qa:0});this.Sc=a}return this.Sc}}); U(ag,{setCenter:ag.Xf,setRadius:ag.wf});var kh={bt:function(a){kh["_"+a.ba]||(kh["_"+a.ba]={});switch(a.B.gL){case 1:return kh.ZL(a);case 2:return kh.dM(a);case 3:return kh.WD(a)}if(J()&&kh.DM()&&4!==a.B.gL)return kh.WD(a);if(kh.PY())return kh.ZL(a);if(kh.QY())return kh.dM(a);if(kh.DM())return kh.WD(a)},ZL:function(a){kh["_"+a.ba].EJ||(kh["_"+a.ba].EJ=new B.aQ(a));return kh["_"+a.ba].EJ},dM:function(a){kh["_"+a.ba].PJ||(kh["_"+a.ba].PJ=new B.dQ(a));return kh["_"+a.ba].PJ},WD:function(a){kh["_"+a.ba].mH||(kh["_"+a.ba].mH=new B.BP(a));return kh["_"+ a.ba].mH},QY:function(){if(Ib(kh.KO))return kh.KO;var a=Mb();return kh.KO=a},PY:function(){Ib(kh.JO)||(kh.JO=Nb());return kh.JO},DM:function(){Ib(kh.IO)||(kh.IO=Ob());return kh.IO}};B.qq=kh; ');