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
19 KiB
1 line
19 KiB
/**/_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.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,j=x.K.ia(c.Ua);b.Wa=new R(i-j.left,g-j.top);b.point=c.Bg(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"!==qh.ot(this.map).Cp()&&!J()&&(c.z.jf&&(b.style.cursor="pointer",x.M(b,"click",function(b){c.YI&&c.YI.ab(c.map.wc())&&c.dispatchEvent(a(b,na(new N("onclick"),b)))}),x.M(b,"dblclick",function(b){c.dispatchEvent(a(b,na(new N("ondblclick"),b)))}),(!x.da.Te||4>x.da.Te)&&x.M(this.V,"contextmenu",function(b){c.dispatchEvent(a(b,na(new N("onrightclick"),b)))})),x.M(b,"mousedown",function(b){c.dispatchEvent(a(b,na(new N("onmousedown"),b)));c.YI=c.map.wc()}), x.M(b,"mouseup",function(b){c.dispatchEvent(a(b,na(new N("onmouseup"),b)))}),x.M(this.V,"mouseup",function(b){c.dispatchEvent(a(b,na(new N("onmouseup"),b)));x.da.Te>=4&&(b.button===2&&c.z.jf)&&c.dispatchEvent(a(b,na(new N("onrightclick"),b)))}));b=p;this.Pi||(this.Pi=o,this.Jv=function(a){if(c.map&&!c.map.R.zv){var b=c.aT(a.point),f=parseFloat(b.Ca),g;if(f<c.z.AN){g=c.Qa.uy?new N("onmousemove"):new N("onmouseover");c.Qa.WM=q;c.Qa.uy=o}else if(!c.Qa.WM&&c.Qa.uy){g=new N("onmouseout");c.Qa.uy=q;c.Qa.WM= o}if(g){if(!(c instanceof Dd)&&g.type==="onmousemove"&&c.Qa.uy===o&&(f===0||f>c.z.AN)){g.pixel=g.Wa=a.Wa;g.point=g.point=a.point;g.pointN=g.Cg=$a(a.point,c.map)}else{g.point=g.point=this.YN(b.Wa);g.pointN=g.Cg=this.cU(b.Wa);g.pixel=g.Wa=this.Zp(g.point)}c.dispatchEvent(g)}}},this.map.addEventListener("onmousemove",this.Jv),this.addEventListener("mouseover",t()),this.addEventListener("mouseout",t()))},draw:function(a){this.V&&this.lo&&("canvas"===this.lo.Lb&&this.lw?(this.lw(),this.lo.me(this.V,this.yr(this.ha), this.z)):this.lo.me(this.V,this.yr(this.ha)),this instanceof Dd&&this.z.ti&&this.dS(a))},Ab:function(){this.map&&(this.initialize(this.map),this.V.style.WebkitUserSelect="none",this.draw())},yr:function(a){var b=this.map,c=[],d=b.Kd(),e=this.Kd();if(!d.Mt(e)||0===a.length||!this.V||!this.vg())return[c];this.z.mf||(d=this.Lm(b.ga()),this.gf[d]?a=this.gf[d]:(a=rh(a,this.Fk(b.ga())),a=this.gf[d]=a));d=this.z.O0;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]},Lm:function(a){return this.z.Lm?this.z.Lm(a):6>a?0:10>a?1:15>a?2:3},Fk:function(a){return this.z.Fk?this.z.Fk(a):ld.xF[this.Lm(a)]},js:function(a){this.gf.length=0;a=ld.Ox(a);this.Mo=a.slice(0,a.length-1);this.ha=a.slice(0);this.Ih();this.draw();this.dispatchEvent(new N("onlineupdate"))},me:function(a){this.js(a);this.z.mf===o&&(this.uk(),this.gm())},Bn: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.uk(),this.gm()), this.draw(),this.dispatchEvent(new N("onlineupdate")))},setStrokeColor:function(a){this.z&&(this.z.strokeColor=a);this.Yl("strokecolor",a)},pq:function(a){0<a&&(this.z.mc=a,this.Yl("strokeweight",a),"dashed"===this.lM()&&(this.map&&"svg"===qh.ot(this.map).Cp())&&this.Yl("strokestyle","dashed"))},nq:function(a){a===k||(1<a||0>a)||(this.z.td=a,this.map&&this.Yl("strokeopacity",a))},nu:function(a){1<a||0>a||(this.z.sg=a,this.Yl("fillopacity",a))},oq:function(a){"solid"!==a&&"dashed"!==a||(this.z.strokeStyle= a,this.Yl("strokestyle",a))},setFillColor:function(a){this.z.fillColor=a||"";this.Yl("fillcolor",a)},Yl:function(a,b){this.lo&&(this.lo.setAttribute(this.V,a,b||"",this.mM()),this.dispatchEvent(new N("onlineupdate")))},gm:function(){var a=this;if(!a.nc.length)for(var b=this.rM(),c=function(b){a.Zv(b)},d=t(),e=function(b){a.DB(b)},f=0,g=b.length;f<g;f++){var i=b[f],j=new mh(i.yb,i.qa);j.addEventListener("ondragging",c);j.addEventListener("ondragstart",d);j.addEventListener("ondragend",e);j.index=f; j.qa=i.qa;this.nc.push(j);this.map&&this.map.Ka(j)}},uk:function(){for(var a;a=this.nc.pop();)this.map.Ub(a);this.nc.length=0},rM: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},e2:t(),DB: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.Cg,a=a.currentTarget.index,c;if(0!==a%2){this.vA(a);this.Rq(a,b,0);var d=$a(this.Sc[a-1].yb,this.map);c=$a(this.Sc[a+1].yb,this.map);d=this.lt(d,b);c=this.lt(b,c);this.Rq(a,d,1);this.Rq(a+2,c,1);a=Math.ceil(a/2);c=this.ha.slice();a=c.splice(a,this.ha.length-a);c[c.length]=hb(b,this.map);c=c.concat(a)}else this.Sc[a].yb=b,0<=a-2&&(d=$a(this.Sc[a-2].yb,this.map),d=this.lt(d,b),this.nc[a-1].show(),this.nc[a-1].ta(d)),a+2<this.Sc.length&&(c=$a(this.Sc[a+2].yb,this.map),c=this.lt(b, c),this.nc[a+1].show(),this.nc[a+1].ta(c)),this instanceof Cd&&this.Sc.length-1===a&&(this.vA(0),this.Rq(0,b,0),this.vA(1),this.Rq(1,this.lt($a(this.Sc[0].yb,this.map),$a(this.Sc[1].yb,this.map)),1),this.nc[0].V.style.zIndex="-10000000"),a/=2,this.ha.splice(a,1,hb(b,this.map)),this instanceof Cd&&this.ha.length-1===a&&this.ha.splice(0,1,hb(b,this.map)),c=this.ha;b=0;for(a=this.nc.length;b<a;b++)this.nc[b].index=b;this.ha=c;this.js(c)},Rq:function(a,b,c){var d=this;this.Sc.splice(a,0,{yb:b,qa:c}); b=new mh(b,c);b.addEventListener("ondragging",function(a){d.Zv(a)});b.addEventListener("ondragstart",t());b.addEventListener("ondragend",function(a){d.DB(a)});b.index=a;b.qa=c;this.nc.splice(a,0,b);this.map.Ka(b)},vA:function(a){this.map.Ub(this.nc[a]);this.Sc.splice(a,1);this.nc.splice(a,1)},lt:function(a,b){return new K((a.lng+b.lng)/2,(a.lat+b.lat)/2)},aT:function(a){var b,c,d,e,f,g,i=[],j=this.map.We(a),i=this.yr(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*j.x+(n.y-f*n.x)-j.y)/Math.sqrt(f*f+1)):f=Math.abs(j.x-n.x);var s=Math.pow(n.y-m.y,2)+Math.pow(n.x-m.x,2),n=Math.pow(n.y-j.y,2)+Math.pow(n.x-j.x,2),m=Math.pow(m.y-j.y,2)+Math.pow(m.x-j.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 Dd)){f=j=0;s=this.ha;for(e=0;e<l;e++)j=e===l-1?0:j+1,s[e].lat!==s[j].lat&&((a.lat>=s[e].lat&&a.lat< s[j].lat||a.lat>=s[j].lat&&a.lat<s[e].lat)&&a.lng<(s[j].lng-s[e].lng)*(a.lat-s[e].lat)/(s[j].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(){kb.prototype.show.call(this);this.draw();this.z.mf===o&&this.gm()},U:function(){kb.prototype.U.call(this);this.z.mf===o&&this.uk()},remove:function(){jd.prototype.remove.call(this);this.z.mf===o&&this.uk()}}); function sh(a,b){var c={top:0,bottom:0,right:0,left:0,all:0},d=a.x,e=a.y;e<b.yN?(c.top=8,c.all+=c.top):e>b.uN&&(c.bottom=4,c.all+=c.bottom);d>b.tN?(c.right=2,c.all+=c.right):d<b.xN&&(c.left=1,c.all+=c.left);return c} function rh(a,b){if(1>=a.length)return a;var c=a,d=b!==k?b*b:1,e=c.length,f=new ("undefined"!==typeof Uint8Array?Uint8Array:Array)(e),g=0,i=e-1,j=[],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 A=((s.lng-D)*C+(s.lat-w)*F)/(C*C+F*F);1<A?(D=y.lng,w=y.lat):0<A&&(D+=C*A,w+=F*A)}C=s.lng-D;F=s.lat-w;s=C*C+F*F;s>n&&(u=m,n=s)}n>d&&(f[u]=1,j.push(g,u,u,i));i=j.pop();g=j.pop()}for(m=0;m<e;m++)f[m]&&l.push(c[m]);return l} U(eg,{show:eg.show,hide:eg.U,remove:eg.remove,setPath:eg.me,setPositionAt:eg.Bn,setStrokeColor:eg.setStrokeColor,setStrokeWeight:eg.pq,setStrokeOpacity:eg.nq,setFillOpacity:eg.nu,setStrokeStyle:eg.oq,setFillColor:eg.setFillColor});x.extend(Dd.prototype,{initialize:function(a){ld.prototype.initialize.call(this,a);this.BJ=[0];this.hs=[0];this.Wl=[0];for(var a=1,b=this.ha,c=b.length;a<c;a++){this.BJ[a]=T.rp(b[a],b[a-1]);var d=T.tb(b[a-1]),e=T.tb(b[a]);this.hs[a]=90-180*Math.atan2(e.lat-d.lat,e.lng-d.lng)/Math.PI;this.Wl[a]=this.Wl[a-1]+this.BJ[a]}this.DT=this.Wl[c-1];this.lw();this.kw={};return this.V},lw:function(){this.setFillColor("");this.setStrokeColor(this.z.strokeColor);this.pq(this.z.mc);this.oq(this.z.strokeStyle);this.nq(this.z.td)}, yr:function(a){var b=this.map,c=[],d=b.Kd(),e=this.Kd();if(!d.Mt(e)||0==a.length||!this.V||!this.vg())return[c];!(J()&&5E3<a.length)&&!this.z.mf&&(d=this.Lm(b.ga()),this.gf[d]?a=this.gf[d]:(e=rh(a,this.Fk(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.Cx;b={xN:-d-f,yN:-e-f,tN:-d+f+b.width,uN:-e+f+b.height};d=0;for(e=c.length-1;d<e;d++){var i=c[d],j=c[d+1],f=b,l=g=q,m=q,i=new R(i.x,i.y), j=new R(j.x,j.y),n=sh(i,f),s=sh(j,f),u=k,w=k,y=k,D=f.xN,C=f.yN,F=f.tN,A=f.uN;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+(j.x-i.x)*(C-i.y)/(j.y-i.y),y=C):u.bottom?(w=i.x+(j.x-i.x)*(A-i.y)/(j.y-i.y),y=A):u.right?(y=i.y+(j.y-i.y)*(F-i.x)/(j.x-i.x),w=F):u.left&&(y=i.y+(j.y-i.y)*(D-i.x)/(j.x-i.x),w=D),l=o,u.all===n.all)?(i.x=Math.round(w),i.y=Math.round(y),n=sh(i,f)):(j.x=Math.round(w),j.y=Math.round(y),s=sh(j,f));while(!m);f=g?{dO:new R(i.x,i.y),eO:new R(j.x,j.y), clip:l?o:q}:k;f&&a.push(f)}c=[[]];d=0;for(e=a.length;d<e;d++)a[d].clip?(c[c.length-1].push(a[d].dO),c[c.length-1].push(a[d].eO),a[d+1]&&a[d+1].clip&&c.push([])):(c[c.length-1].push(a[d].dO),d==a.length-1&&c[c.length-1].push(a[d].eO));return c},hide:function(){ld.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(){ld.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()}, dS:function(a){var b=this.Tx(),c=b.ga(),d=b.Kd();icons=this.z.ti;displayPixels=ld.prototype.yr.call(this,this.ha);if(this.kw[c]&&0<this.kw[c].length)this.$i=this.kw[c];else{for(var e=[0],f=1,g=displayPixels[0],i=g.length;f<i;f++)e[f]=e[f-1]+Ib(g[f],g[f-1]);this.$i=this.kw[c]=e}for(f=0;f<icons.length;f++){var e=icons[f],g=e.o0,j,l,m;e.cw[c]&&0<e.cw[c].length?m=e.cw[c]:e.cw[c]=m=e.aR(this);if(1===m.length)d.mx(m[0].point)&&(e.jd[0]&&(b.Ub(e.jd[0]),e.jd[0].remove()),e.KL||(7===g.Lb||5===g.Lb?g.setRotation&& g.setRotation(-180+this.hs[m[0].index]):g.setRotation&&g.setRotation(this.hs[m[0].index])),e.jd[0]=new W(m[0].point,{icon:g}),b.Ka(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.kc.Fb(e.jd,function(a){b.Ub(a);a.remove()});e.jd=[];for(n=0;n<m.length;n++){l=m[n].index;j=m[n].point;var s=""+j.lat+(""+j.lng);d.mx(j)&&!i[s]&&(e.KL||(7===g.Lb||5===g.Lb?g.setRotation&&g.setRotation(-180+this.hs[l]):g.setRotation&&g.setRotation(this.hs[l])), j=new W(j,{icon:g}),e.jd.push(j),b.Ka(j))}}}},Zv:function(a){var b=a.currentTarget,c=a.Cg,d=b.index,e=this.Sc,f,g=a=p;if(0==d){var i=$a(e[d+2].yb,this.map);f=[c,i];a=new K((i.lng+c.lng)/2,(i.lat+c.lat)/2);this.nc[d+1]&&this.nc[d+1].U()}else if(d==e.length-1){var j=$a(e[d-2].yb,this.map);f=[j,c];a=new K((j.lng+c.lng)/2,(j.lat+c.lat)/2);this.nc[d-1]&&this.nc[d-1].U()}else j=e[d-1].yb,i=e[d+1].yb,f=[j,c,i],b.qa||(j=$a(e[d-2].yb,this.map),i=$a(e[d+2].yb,this.map),f=[j,c,i],a=new K((j.lng+c.lng)/2,(j.lat+ c.lat)/2),g=new K((i.lng+c.lng)/2,(i.lat+c.lat)/2),this.nc[d-1]&&this.nc[d-1].U(),this.nc[d+1]&&this.nc[d+1].U());this.Qa.kj?(this.Qa.kj.me(f),this.Qa.kj.show()):(b=new Dd(f,{strokeStyle:"dashed",strokeColor:this.z.strokeColor,mc:this.z.mc,td:this.z.td}),this.map.Ka(b),b.U(),this.Qa.kj=b);!this.Qa.Ci&&a?(this.Qa.Ci=new mh(a,1),this.map.Ka(this.Qa.Ci)):a&&this.Qa.Ci.ta(a);!this.Qa.yi&&g?(this.Qa.yi=new mh(g,1),this.map.Ka(this.Qa.yi)):g&&this.Qa.yi.ta(g)}}); x.kc.remove=function(a,b){for(var c=a.length;c--;)a[c]===b&&a.splice(c,1);return a};x.extend(Cd.prototype,{initialize:function(a){ld.prototype.initialize.call(this,a);this.setStrokeColor(this.z.strokeColor);this.pq(this.z.mc);this.oq(this.z.strokeStyle);this.setFillColor(this.z.fillColor);this.nq(this.z.td);this.nu(this.z.sg);return this.V},Bn:function(a,b){this.Mo[a]&&(this.gf.length=0,this.Mo[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.uk(),this.gm()), this.draw(),this.dispatchEvent(new N("onlineupdate")))},lw:function(){this.setStrokeColor(this.z.strokeColor);this.pq(this.z.mc);this.oq(this.z.strokeStyle);this.setFillColor(this.z.fillColor);this.nq(this.z.td);this.nu(this.z.sg)},containPoint:function(a){var b=this.ha,c=q;if(a instanceof O||a instanceof O){if(this.lv.mx(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,j=b[f].lat,f=b[f].lng;i>a!=f>a&&d<(j-g)*(a-i)/(f-i)+g&&(c=!c)}return c}return q}},Zv:function(a){var b= a.currentTarget,c=a.point,d=b.index,e=this.Sc,f,g=a=p;if(0==d){var i=hb(e[e.length-2].yb,this.map),j=hb(e[d+2].yb,this.map);f=[i,c,j];b.qa||(a=new O((i.lng+c.lng)/2,(i.lat+c.lat)/2),g=new O((j.lng+c.lng)/2,(j.lat+c.lat)/2))}else d==e.length-1?(j=hb(e[2].yb,this.map),i=hb(e[d-2].yb,this.map),f=[i,c,j],b.qa||(a=new O((i.lng+c.lng)/2,(i.lat+c.lat)/2),g=new O((j.lng+c.lng)/2,(j.lat+c.lat)/2))):(i=hb(e[d-1].yb,this.map),j=hb(e[d+1].yb,this.map),f=[i,c,j],b.qa||(i=hb(e[d-2].yb,this.map),j=hb(e[d+2].yb, this.map),f=[i,c,j],a=new O((i.lng+c.lng)/2,(i.lat+c.lat)/2),g=new O((j.lng+c.lng)/2,(j.lat+c.lat)/2),this.nc[d-1]&&this.nc[d-1].U(),this.nc[d+1]&&this.nc[d+1].U()));this.Qa.kj?this.Qa.kj.me(f):(b=new Dd(f,{strokeStyle:"dashed",strokeColor:this.z.strokeColor,mc:this.z.mc,td:this.z.td}),this.map.Ka(b),this.Qa.kj=b);!this.Qa.Ci&&a?(this.Qa.Ci=new mh(a,1),this.map.Ka(this.Qa.Ci)):a&&this.Qa.Ci.ta(a);!this.Qa.yi&&g?(this.Qa.yi=new mh(g,1),this.map.Ka(this.Qa.yi)):g&&this.Qa.yi.ta(g)}});U(gg,{setPositionAt:gg.Bn});x.extend(Ed.prototype,{initialize:function(a){Cd.prototype.initialize.call(this,a);this.ha=this.Fv(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.Fv(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.Fv(this.point,this.xa),this.Ih(),this.draw(),this.dispatchEvent(new N("onlineupdate")))},Fk:function(a){return this.z.Fk? this.z.Fk(a):Ed.xF[this.Lm(a)]},Zv: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.rp($a(b,this.map),$a(a,this.map)),o);this.Xf(b,o)},DB: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.uk();this.gm()},rM: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(fg,{setCenter:fg.Xf,setRadius:fg.wf});var qh={ot:function(a){qh["_"+a.ba]||(qh["_"+a.ba]={});switch(a.B.vL){case 1:return qh.nM(a);case 2:return qh.sM(a);case 3:return qh.iE(a)}if(J()&&qh.SM()&&4!==a.B.vL)return qh.iE(a);if(qh.iZ())return qh.nM(a);if(qh.jZ())return qh.sM(a);if(qh.SM())return qh.iE(a)},nM:function(a){qh["_"+a.ba].TJ||(qh["_"+a.ba].TJ=new B.tQ(a));return qh["_"+a.ba].TJ},sM:function(a){qh["_"+a.ba].dK||(qh["_"+a.ba].dK=new B.wQ(a));return qh["_"+a.ba].dK},iE:function(a){qh["_"+a.ba].BH||(qh["_"+a.ba].BH=new B.UP(a));return qh["_"+ a.ba].BH},jZ:function(){if(Kb(qh.aP))return qh.aP;var a=Ob();return qh.aP=a},iZ:function(){Kb(qh.$O)||(qh.$O=Pb());return qh.$O},SM:function(){Kb(qh.ZO)||(qh.ZO=Qb());return qh.ZO}};B.Eq=qh; '); |