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