/**/_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=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));ca.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=[];0a[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(fc.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;ea?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){0a)||(this.z.td=a,this.map&&this.Sl("strokeopacity",a))},bu:function(a){1a||(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;fs&&(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=s[e].lat&&a.lat< s[k].lat||a.lat>=s[k].lat&&a.latb.fN&&(c.bottom=4,c.all+=c.bottom);d>b.eN?(c.right=2,c.all+=c.right):d=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;mn&&(u=m,n=s)}n>d&&(f[u]=1,k.push(g,u,u,i));i=k.pop();g=k.pop()}for(m=0;ma!=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; ');