/* 百度地图API V2 模块
 * 此模块必须配套使用baidumap_offline_v2_20160822.js对
 * 获取模块的方法：
 * http://api0.map.bdimg.com/getmodules?v=2.0&mod=模块1,模块2
 * 模块名称就是文件名
 * www.xiaoguo123.com 整理
 */
 _jsload2&&_jsload2('poly', 'function dg(a,b){gb.call(this);this.point=a;this.type=b;this.z={}}x.lang.ta(dg,gb,"Vertex"); x.extend(dg.prototype,{initialize:function(a){this.map=a;var b="",b=this.type?"BMap_vectex BMap_vectex_nodeT":"BMap_vectex BMap_vectex_node",c=this.fH=this.V=document.createElement("div");c.className=b;a.Qf().OO.appendChild(c);this.vA();return c},draw:function(){var a=this.map.Re(this.point);this.fH.style.left=a.x-5+"px";this.fH.style.top=a.y-5+"px"},sa:function(a){a instanceof H&&(this.point=this.z.point=new H(a.lng,a.lat),this.draw())},ha:t("point"),vA:function(){function a(a,b){b.pixel=b.ib=a.ib; 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 Q(b,c)}if(this.V&&!this.V.Li){this.V.Li=o;var c=this.map,d=this,e=0,f=0,g=0,i={x:0,y:0};this.zs=function(a){na(a);if(2!=a.button){d.ml=o;var i=c.ac(d.point),m=b(a);e=m.x-i.x;f=m.y-i.y;g=ab();d.map.R.Yu=d;x.M(document,"mousemove",d.kj);x.M(document,"mouseup",d.jj);x.M(document,"touchmove",d.kj);x.M(document,"touchend",d.jj);d.V&&d.V.setCapture&& d.V.setCapture();d.V.style.cursor=d.z.Ed;"touchstart"==a.type&&ma(a)}};this.kj=function(g){if(d.ml){g=b(g);i=g=new Q(g.x-e,g.y-f);d.Uz=g;var l=d.map.ub(g),m={ib:g,point:l};d.zl=d.Al=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.zl=8:g.x>=d.map.width-20&&(d.zl=-8),50>=g.y?d.Al=8:g.y>=d.map.height-10&&(d.Al=-8),!d.Be)d.Be=setInterval(function(){c.yg(d.zl,d.Al,{noAnimation:o});var a=c.ub(d.Uz);d.sa(a)},30)}else d.Be&&(clearInterval(d.Be),d.Be=p),d.sa(l);d.el||(d.dispatchEvent(a(m, new N("ondragstart"))),d.el=o);d.dispatchEvent(a(m,new N("ondragging")))}};this.jj=function(){d.V&&d.V.releaseCapture&&d.V.releaseCapture();d.ml=q;d.map.R.Yu=p;x.cd(document,"mousemove",d.kj);x.cd(document,"mouseup",d.jj);x.cd(document,"touchmove",d.kj);x.cd(document,"touchend",d.jj);e=f=0;d.Be&&(clearInterval(d.Be),d.Be=p);if(100<=ab()-g&&(2<i.x||2<i.y))d.el=q,d.dispatchEvent(a({ib:d.map.ac(d.ha()),point:d.ha()},new N("ondragend"))),i.x=i.y=0;d.Ml();d.V&&(d.V.style.cursor=d.z.ff?"pointer":"")};x.M(this.V, "mousedown",this.zs);x.M(this.V,"touchstart",this.zs)}}});x.extend(pc.prototype,{hQ:function(a){return this.repeat?this.jQ(a):this.iQ(a)},jQ:function(a){var b=this.repeat,c=[],d,e,f;if(this.FI){d=Math.floor(1/this.repeat)+1;for(e=0;e<d;e++)c.push(eg(a,1-b*e,o))}else{f=a.Wi[a.Wi.length-1];d=Math.floor(f/b)+1;for(e=0;e<d;e++)c.push(eg(a,f-e*b,q))}return c},iQ:function(a){return[eg(a,this.$j,this.EI)]},hide:function(){if(this.Vc&&0<this.Vc.length)for(var a=this.Vc.length-1;0<=a;a--)this.Vc[a].U()},show:function(){if(this.Vc&&0<this.Vc.length)for(var a=this.Vc.length- 1;0<=a;a--)this.Vc[a].show()}});function eg(a,b,c){var d=a.ia;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.LS*b;b=fg(c,a.Gl);a=(c-a.Gl[b-1])/(a.Gl[b]-a.Gl[b-1])}else{c=b;b=a.Wi[a.Wi.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=fg(c,a.Wi);a=(c-a.Wi[b-1])/(a.Wi[b]-a.Wi[b-1])}c=d[b-1];d=d[b];return{point:new H(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 fg(a,b){var c=gg(b.concat(a));return x.jc.indexOf(c,a)}function gg(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=gg(c),a=gg(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(lc.prototype,{initialize:function(a){a&&this.iv&&a.addEventListener("onmousemove",this.iv);a=gb.prototype.initialize.call(this,a);this.z.Nf===o&&(this.mk(),this.Rl());return a},Hj:function(){this.V=(this.Rn=hg.Os(this.map)).wo()},ca:function(){function a(a,b){var c=a.srcElement||a.target,g=Cb(),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.Mc(c.ba).map,k=x.D.ha(c.Ua);b.ib=new Q(i-k.left,g-k.top);b.point=c.ub(b.ib);b.pixel=b.ib;b.point=b.point}return b} var b=this.V,c=this;"canvas"!==hg.Os(this.map).fp()&&!G()&&(c.z.ff&&(b.style.cursor="pointer",x.M(b,"click",function(b){c.mI&&c.mI.mb(c.map.Ja())&&c.dispatchEvent(a(b,la(new N("onclick"),b)))}),x.M(b,"dblclick",function(b){c.dispatchEvent(a(b,la(new N("ondblclick"),b)))}),(!x.ea.rg||4>x.ea.rg)&&x.M(this.V,"contextmenu",function(b){c.dispatchEvent(a(b,la(new N("onrightclick"),b)))})),x.M(b,"mousedown",function(b){c.dispatchEvent(a(b,la(new N("onmousedown"),b)));c.mI=c.map.Ja()}),x.M(b,"mouseup",function(b){c.dispatchEvent(a(b, la(new N("onmouseup"),b)))}),x.M(this.V,"mouseup",function(b){c.dispatchEvent(a(b,la(new N("onmouseup"),b)));x.ea.rg>=4&&(b.button===2&&c.z.ff)&&c.dispatchEvent(a(b,la(new N("onrightclick"),b)))}));b=p;this.Li||(this.Li=o,this.iv=function(a){if(c.map&&!c.map.R.Yu){var b=c.iS(a.point),f=parseFloat(b.Aa),g;if(f<c.z.NM){g=c.Qa.Nx?new N("onmousemove"):new N("onmouseover");c.Qa.lM=q;c.Qa.Nx=o}else if(!c.Qa.lM&&c.Qa.Nx){g=new N("onmouseout");c.Qa.Nx=q;c.Qa.lM=o}if(g){if(!(c instanceof Ac)&&g.type==="onmousemove"&& c.Qa.Nx===o&&(f===0||f>c.z.NM)){g.pixel=g.ib=a.ib;g.point=g.point=a.point}else{g.point=g.point=this.kN(b.ib);g.pixel=g.ib=this.ac(g.point)}c.dispatchEvent(g)}}},this.map.addEventListener("onmousemove",this.iv),this.addEventListener("mouseover",s()),this.addEventListener("mouseout",s()))},draw:function(a){this.V&&this.Rn&&("canvas"===this.Rn.Lb&&this.Hv?(this.Hv(),this.Rn.ge(this.V,this.Wq(this.ia),this.z)):this.Rn.ge(this.V,this.Wq(this.ia)),this instanceof Ac&&this.z.ni&&this.kR(a))},wb:function(){this.map&& (this.initialize(this.map),this.V.style.WebkitUserSelect="none",this.draw())},Wq:function(a){var b=this.map,c=[],d=b.Gd(),e=this.Gd();if(!d.ft(e)||0===a.length||!this.V||!this.mh())return[c];this.z.Nf||(d=this.sm(b.fa()),this.bf[d]?a=this.bf[d]:(a=ig(a,this.wk(b.fa())),a=this.bf[d]=a));d=this.z.V_;c.push(b.Re(a[0],p,d));for(var f=e=1,g=a.length;e<g;e++){var i=b.Re(a[e],p,d);i.mb(c[f-1])||(c.push(i),f++)}return[c]},sm:function(a){return this.z.sm?this.z.sm(a):6>a?0:10>a?1:15>a?2:3},wk:function(a){return this.z.wk? this.z.wk(a):lc.QE[this.sm(a)]},Ir:function(a){this.bf.length=0;a=lc.ix(a);this.ro=a.slice(0,a.length-1);this.ia=a.slice(0);this.Eh();this.draw();this.dispatchEvent(new N("onlineupdate"))},ge:function(a){this.Ir(a);this.z.Nf===o&&(this.mk(),this.Rl())},hn:function(a,b){b&&this.ia[a]&&(this.bf.length=0,this.ia[a]=new H(b.lng,b.lat),this.Eh(),this.z.Nf===o&&(this.mk(),this.Rl()),this.draw(),this.dispatchEvent(new N("onlineupdate")))},setStrokeColor:function(a){this.z&&(this.z.strokeColor=a);this.Il("strokecolor", a)},Op:function(a){0<a&&(this.z.mc=a,this.Il("strokeweight",a),"dashed"===this.AL()&&(this.map&&"svg"===hg.Os(this.map).fp())&&this.Il("strokestyle","dashed"))},Mp:function(a){a===j||(1<a||0>a)||(this.z.sd=a,this.map&&this.Il("strokeopacity",a))},Lt:function(a){1<a||0>a||(this.z.qg=a,this.Il("fillopacity",a))},Np:function(a){"solid"!==a&&"dashed"!==a||(this.z.strokeStyle=a,this.Il("strokestyle",a))},setFillColor:function(a){this.z.fillColor=a||"";this.Il("fillcolor",a)},Il:function(a,b){this.Rn&& (this.Rn.setAttribute(this.V,a,b||"",this.BL()),this.dispatchEvent(new N("onlineupdate")))},Rl:function(){var a=this;if(!a.nc.length)for(var b=this.GL(),c=function(b){a.xv(b)},d=s(),e=function(b){a.YA(b)},f=0,g=b.length;f<g;f++){var i=b[f],k=new dg(i.Ab,i.Ac);k.addEventListener("ondragging",c);k.addEventListener("ondragstart",d);k.addEventListener("ondragend",e);k.index=f;k.Ac=i.Ac;this.nc.push(k);this.map.Ia(k)}},mk:function(){for(var a;a=this.nc.pop();)this.map.Sb(a);this.nc.length=0},GL:function(){for(var a= [],b=0,c=this.ia.length;b<c;b++){var d=this.ia[b];a.push({Ab:d,Ac:0});if(b<c-1){var e=this.ia[b+1],d=new H((d.lng+e.lng)/2,(d.lat+e.lat)/2);a.push({Ab:d,Ac:1})}}return this.Sc=a},R0:s(),YA:function(a){this.Qa.ij&&(this.map.Sb(this.Qa.ij),delete this.Qa.ij);this.Qa.xi&&(this.map.Sb(this.Qa.xi),delete this.Qa.xi);this.Qa.si&&(this.map.Sb(this.Qa.si),delete this.Qa.si);var b=a.point,a=a.currentTarget.index,c;if(0!==a%2){this.Pz(a);this.qq(a,b,0);var d=this.Sc[a-1].Ab;c=this.Sc[a+1].Ab;d=this.Ls(d,b); c=this.Ls(b,c);this.qq(a,d,1);this.qq(a+2,c,1);a=Math.ceil(a/2);c=this.ia.slice();a=c.splice(a,this.ia.length-a);c[c.length]=b;c=c.concat(a)}else this.Sc[a].Ab=b,0<=a-2&&(d=this.Sc[a-2].Ab,d=this.Ls(d,b),this.nc[a-1].show(),this.nc[a-1].sa(d)),a+2<this.Sc.length&&(c=this.Sc[a+2].Ab,c=this.Ls(b,c),this.nc[a+1].show(),this.nc[a+1].sa(c)),this instanceof zc&&this.Sc.length-1===a&&(this.Pz(0),this.qq(0,b,0),this.Pz(1),this.qq(1,this.Ls(this.Sc[0].Ab,this.Sc[1].Ab),1),this.nc[0].V.style.zIndex="-10000000"), a/=2,this.ia.splice(a,1,b),this instanceof zc&&this.ia.length-1===a&&this.ia.splice(0,1,b),c=this.ia;b=0;for(a=this.nc.length;b<a;b++)this.nc[b].index=b;this.ia=c;this.Ir(c)},qq:function(a,b,c){var d=this;this.Sc.splice(a,0,{Ab:b,Ac:c});b=new dg(b,c);b.addEventListener("ondragging",function(a){d.xv(a)});b.addEventListener("ondragstart",s());b.addEventListener("ondragend",function(a){d.YA(a)});b.index=a;b.Ac=c;this.nc.splice(a,0,b);this.map.Ia(b)},Pz:function(a){this.map.Sb(this.nc[a]);this.Sc.splice(a, 1);this.nc.splice(a,1)},Ls:function(a,b){return new H((a.lng+b.lng)/2,(a.lat+b.lat)/2)},iS:function(a){var b,c,d,e,f,g,i=[],k=this.map.Re(a),i=this.Wq(this.ia)[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 u=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),v=Math.pow(f,2);n-v+m-v>u&&(f=Math.sqrt(Math.min(n, m)));if(b==p||b>f)c=Math.sqrt(m-v)/Math.sqrt(u),d=Math.sqrt(n-v)/Math.sqrt(u),b=f,g=e;b=Math.min(b,f)}}if(!(this instanceof Ac)){f=k=0;u=this.ia;for(e=0;e<l;e++)k=e===l-1?0:k+1,u[e].lat!==u[k].lat&&((a.lat>=u[e].lat&&a.lat<u[k].lat||a.lat>=u[k].lat&&a.lat<u[e].lat)&&a.lng<(u[k].lng-u[e].lng)*(a.lat-u[e].lat)/(u[k].lat-u[e].lat)+u[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{ib:new Q(e,f),Aa:b}},show:function(){gb.prototype.show.call(this); this.draw();this.z.Nf===o&&this.Rl()},U:function(){gb.prototype.U.call(this);this.z.Nf===o&&this.mk()},remove:function(){jc.prototype.remove.call(this);this.z.Nf===o&&this.mk()}});function jg(a,b){var c={top:0,bottom:0,right:0,left:0,all:0},d=a.x,e=a.y;e<b.LM?(c.top=8,c.all+=c.top):e>b.HM&&(c.bottom=4,c.all+=c.bottom);d>b.GM?(c.right=2,c.all+=c.right):d<b.KM&&(c.left=1,c.all+=c.left);return c} function ig(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,u,v;for(f[g]=f[i]=1;i;){n=0;for(m=g+1;m<i;m++){u=c[m];var w=c[g],y=c[i],C=w.lng,w=w.lat,A=y.lng-C,B=y.lat-w;if(0!==A||0!==B){var D=((u.lng-C)*A+(u.lat-w)*B)/(A*A+B*B);1<D?(C=y.lng,w=y.lat):0<D&&(C+=A*D,w+=B*D)}A=u.lng-C;B=u.lat-w;u=A*A+B*B;u>n&&(v=m,n=u)}n>d&&(f[v]=1,k.push(g,v,v,i));i=k.pop();g=k.pop()}for(m=0;m<e;m++)f[m]&&l.push(c[m]);return l} S(Xe,{show:Xe.show,hide:Xe.U,remove:Xe.remove,setPath:Xe.ge,setPositionAt:Xe.hn,setStrokeColor:Xe.setStrokeColor,setStrokeWeight:Xe.Op,setStrokeOpacity:Xe.Mp,setFillOpacity:Xe.Lt,setStrokeStyle:Xe.Np,setFillColor:Xe.setFillColor});x.extend(Ac.prototype,{initialize:function(a){lc.prototype.initialize.call(this,a);this.RI=[0];this.Gr=[0];this.Gl=[0];for(var a=1,b=this.ia,c=b.length;a<c;a++){this.RI[a]=R.Vo(b[a],b[a-1]);var d=R.xb(b[a-1]),e=R.xb(b[a]);this.Gr[a]=90-180*Math.atan2(e.lat-d.lat,e.lng-d.lng)/Math.PI;this.Gl[a]=this.Gl[a-1]+this.RI[a]}this.LS=this.Gl[c-1];this.Hv();this.Gv={};return this.V},Hv:function(){this.setFillColor("");this.setStrokeColor(this.z.strokeColor);this.Op(this.z.mc);this.Np(this.z.strokeStyle);this.Mp(this.z.sd)}, Wq:function(a){var b=this.map,c=[],d=b.Gd(),e=this.Gd();if(!d.ft(e)||0==a.length||!this.V||!this.mh())return[c];!(G()&&5E3<a.length)&&!this.z.Nf&&(d=this.sm(b.fa()),this.bf[d]?a=this.bf[d]:(e=ig(a,this.wk(b.fa())),a=this.bf[d]=e));c.push(b.Re(a[0]));for(var f=d=1,e=a.length;d<e;d++){var g=b.Re(a[d]);g.mb(c[f-1])||(c.push(g),f++)}a=[];d=b.offsetX;e=b.offsetY;f=b.K.Vw;b={KM:-d-f,LM:-e-f,GM:-d+f+b.width,HM:-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 Q(i.x,i.y), k=new Q(k.x,k.y),n=jg(i,f),u=jg(k,f),v=j,w=j,y=j,C=f.KM,A=f.LM,B=f.GM,D=f.HM;do 0===n.all&&0===u.all?m=g=o:0!==(n.all&u.all)?m=o:(v=0!==n.all?n:u,v.top?(w=i.x+(k.x-i.x)*(A-i.y)/(k.y-i.y),y=A):v.bottom?(w=i.x+(k.x-i.x)*(D-i.y)/(k.y-i.y),y=D):v.right?(y=i.y+(k.y-i.y)*(B-i.x)/(k.x-i.x),w=B):v.left&&(y=i.y+(k.y-i.y)*(C-i.x)/(k.x-i.x),w=C),l=o,v.all===n.all)?(i.x=Math.round(w),i.y=Math.round(y),n=jg(i,f)):(k.x=Math.round(w),k.y=Math.round(y),u=jg(k,f));while(!m);f=g?{oN:new Q(i.x,i.y),pN:new Q(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(){lc.prototype.U.call(this);if(this.z.ni&&0<this.z.ni.length)for(var a=0,b=this.z.ni.length;a<b;a++)this.z.ni[a].hide()},show:function(){lc.prototype.show.call(this);if(this.z.ni&&0<this.z.ni.length)for(var a=0,b=this.z.ni.length;a<b;a++)this.z.ni[a].show()}, kR:function(a){var b=this.nx(),c=b.fa(),d=b.Gd();icons=this.z.ni;displayPixels=lc.prototype.Wq.call(this,this.ia);if(this.Gv[c]&&0<this.Gv[c].length)this.Wi=this.Gv[c];else{for(var e=[0],f=1,g=displayPixels[0],i=g.length;f<i;f++)e[f]=e[f-1]+Eb(g[f],g[f-1]);this.Wi=this.Gv[c]=e}for(f=0;f<icons.length;f++){var e=icons[f],g=e.v_,k,l;e.Bv[c]&&0<e.Bv[c].length?l=e.Bv[c]:e.Bv[c]=l=e.hQ(this);if(1===l.length)d.bs(l[0].point)&&(e.Vc[0]&&(b.Sb(e.Vc[0]),e.Vc[0].remove()),e.$K||(7===g.Lb||5===g.Lb?g.Lp(-180+ this.Gr[l[0].index]):g.Lp(this.Gr[l[0].index])),e.Vc[0]=new T(l[0].point,{icon:g}),b.Ia(e.Vc[0]));else if(1<l.length){var m=[],n,u={};if(a&&"onzoomend"===a.type){for(var v in e.Vc)b.Sb(e.Vc[v]),e.Vc[v].remove();e.Vc=[]}else x.jc.Fb(e.Vc,function(a){d.bs(a.ha())?(n=""+a.ha().lat+(""+a.ha().lng),u[n]=o,m.push(a)):(b.Sb(a),a.remove())}),e.Vc=m;for(v=0;v<l.length;v++){k=l[v].index;var i=l[v].point,w=""+i.lat+(""+i.lng);d.bs(i)&&!u[w]&&(e.$K||(7===g.Lb||5===g.Lb?g.setRotation(-180+this.Gr[k]):g.setRotation(this.Gr[k])), i=new T(i,{icon:g}),e.Vc.push(i),b.Ia(i))}}}},xv:function(a){var b=a.currentTarget,c=a.point,d=b.index,e=this.Sc,f,g=a=p;if(0==d){var i=e[d+2].Ab;f=[c,i];a=new H((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 k=e[d-2].Ab;f=[k,c];a=new H((k.lng+c.lng)/2,(k.lat+c.lat)/2);this.nc[d-1]&&this.nc[d-1].U()}else k=e[d-1].Ab,i=e[d+1].Ab,f=[k,c,i],b.Ac||(k=e[d-2].Ab,i=e[d+2].Ab,f=[k,c,i],a=new H((k.lng+c.lng)/2,(k.lat+c.lat)/2),g=new H((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.ij?(this.Qa.ij.ge(f),this.Qa.ij.show()):(b=new Ac(f,{strokeStyle:"dashed",strokeColor:this.z.strokeColor,mc:this.z.mc,sd:this.z.sd}),this.map.Ia(b),b.U(),this.Qa.ij=b);!this.Qa.xi&&a?(this.Qa.xi=new dg(a,1),this.map.Ia(this.Qa.xi)):a&&this.Qa.xi.sa(a);!this.Qa.si&&g?(this.Qa.si=new dg(g,1),this.map.Ia(this.Qa.si)):g&&this.Qa.si.sa(g)}});x.jc.remove=function(a,b){for(var c=a.length;c--;)a[c]===b&&a.splice(c,1);return a};x.extend(zc.prototype,{initialize:function(a){lc.prototype.initialize.call(this,a);this.setStrokeColor(this.z.strokeColor);this.Op(this.z.mc);this.Np(this.z.strokeStyle);this.setFillColor(this.z.fillColor);this.Mp(this.z.sd);this.Lt(this.z.qg);return this.V},hn:function(a,b){this.ro[a]&&(this.bf.length=0,this.ro[a]=new H(b.lng,b.lat),this.ia[a]=new H(b.lng,b.lat),0==a&&!this.ia[0].mb(this.ia[this.ia.length-1])&&(this.ia[this.ia.length-1]=new H(b.lng,b.lat)),this.Eh(),this.z.Nf==o&&(this.mk(),this.Rl()), this.draw(),this.dispatchEvent(new N("onlineupdate")))},Hv:function(){this.setStrokeColor(this.z.strokeColor);this.Op(this.z.mc);this.Np(this.z.strokeStyle);this.setFillColor(this.z.fillColor);this.Mp(this.z.sd);this.Lt(this.z.qg)},containPoint:function(a){var b=this.ia,c=q;if(!(!a instanceof H)){if(this.Mu.bs(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}},xv:function(a){var b= a.currentTarget,c=a.point,d=b.index,e=this.Sc,f,g=a=p;if(0==d){var i=e[e.length-2].Ab,k=e[d+2].Ab;f=[i,c,k];b.Ac||(a=new H((i.lng+c.lng)/2,(i.lat+c.lat)/2),g=new H((k.lng+c.lng)/2,(k.lat+c.lat)/2))}else d==e.length-1?(k=e[2].Ab,i=e[d-2].Ab,f=[i,c,k],b.Ac||(a=new H((i.lng+c.lng)/2,(i.lat+c.lat)/2),g=new H((k.lng+c.lng)/2,(k.lat+c.lat)/2))):(i=e[d-1].Ab,k=e[d+1].Ab,f=[i,c,k],b.Ac||(i=e[d-2].Ab,k=e[d+2].Ab,f=[i,c,k],a=new H((i.lng+c.lng)/2,(i.lat+c.lat)/2),g=new H((k.lng+c.lng)/2,(k.lat+c.lat)/2),this.nc[d- 1]&&this.nc[d-1].U(),this.nc[d+1]&&this.nc[d+1].U()));this.Qa.ij?this.Qa.ij.ge(f):(b=new Ac(f,{strokeStyle:"dashed",strokeColor:this.z.strokeColor,mc:this.z.mc,sd:this.z.sd}),this.map.Ia(b),this.Qa.ij=b);!this.Qa.xi&&a?(this.Qa.xi=new dg(a,1),this.map.Ia(this.Qa.xi)):a&&this.Qa.xi.sa(a);!this.Qa.si&&g?(this.Qa.si=new dg(g,1),this.map.Ia(this.Qa.si)):g&&this.Qa.si.sa(g)}});S(Ze,{setPositionAt:Ze.hn});x.extend(Bc.prototype,{initialize:function(a){zc.prototype.initialize.call(this,a);this.ia=this.ev(this.point,this.wa);this.Eh();return this.V},Vf:function(a,b){a&&(this.bf.length=0,b||(this.Sc=p),this.point=a,this.ia=this.ev(a,this.wa),this.Eh(),this.draw(),this.dispatchEvent(new N("onlineupdate")))},qf:function(a,b){isNaN(a)||(this.bf.length=0,b||(this.Sc=p),this.wa=Math.abs(a),this.ia=this.ev(this.point,this.wa),this.Eh(),this.draw(),this.dispatchEvent(new N("onlineupdate")))},wk:function(a){return this.z.wk? this.z.wk(a):Bc.QE[this.sm(a)]},xv:function(a){var b,a=a.currentTarget,c=this.Sc;b=c[0].Ab;c=c[c.length-1].Ab;0==a.index?(b=a.ha(),a=c):a=a.ha();this.qf(R.Vo(b,a),o);this.Vf(b,o)},YA:function(a){var a=a.currentTarget,b=a.index;this.Sc[0]={Ab:this.point,Ac:0};1==b&&(this.Sc[1]={Ab:a.point,Ac:0});this.mk();this.Rl()},GL:function(){if(!this.Sc){var a=[];a.push({Ab:this.point,Ac:0});a.push({Ab:this.ia[Math.floor(3*this.ia.length/4)],Ac:0});this.Sc=a}return this.Sc}});S(Ye,{setCenter:Ye.Vf,setRadius:Ye.qf});var hg={Os:function(a){hg["_"+a.ba]||(hg["_"+a.ba]={});switch(a.K.MK){case 1:return hg.CL(a);case 2:return hg.HL(a);case 3:return hg.DD(a)}if(G()&&hg.hM()&&4!==a.K.MK)return hg.DD(a);if(hg.pY())return hg.CL(a);if(hg.qY())return hg.HL(a);if(hg.hM())return hg.DD(a)},CL:function(a){hg["_"+a.ba].iJ||(hg["_"+a.ba].iJ=new z.AP(a));return hg["_"+a.ba].iJ},HL:function(a){hg["_"+a.ba].tJ||(hg["_"+a.ba].tJ=new z.DP(a));return hg["_"+a.ba].tJ},DD:function(a){hg["_"+a.ba].SG||(hg["_"+a.ba].SG=new z.bP(a));return hg["_"+ a.ba].SG},qY:function(){if(Gb(hg.jO))return hg.jO;var a=Kb();return hg.jO=a},pY:function(){Gb(hg.iO)||(hg.iO=Lb());return hg.iO},hM:function(){Gb(hg.hO)||(hg.hO=Mb());return hg.hO}};z.cq=hg; ');
