/* 百度地图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=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));ca.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=[];0a[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(fc.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;ea?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){0a)||(this.z.sd=a,this.map&&this.Il("strokeopacity",a))},Lt:function(a){1a||(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;fu&&(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=u[e].lat&&a.lat=u[k].lat&&a.latb.HM&&(c.bottom=4,c.all+=c.bottom);d>b.GM?(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,u,v;for(f[g]=f[i]=1;i;){n=0;for(m=g+1;mn&&(v=m,n=u)}n>d&&(f[v]=1,k.push(g,v,v,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}},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; ');