/* 百度地图API V2 模块 * 此模块必须配套使用baidumap_offline_v2_20160822.js对 * 获取模块的方法: * http://api0.map.bdimg.com/getmodules?v=2.0&mod=模块1,模块2 * 模块名称就是文件名 * www.xiaoguo123.com 整理 */ _jsload2&&_jsload2('mapclick', 'var Sg=0,Tg=1,Ug=2,Fh,Gh=p;Sa=function(a){this.map=a;this.TE=this.Dw=p;this.Co={};this.EY=8;this.am=[];this.n_=4;this.CF="";this.Pk=this.be=this.ce=this.ve=this.Om=p;this.jp=this.Am="";this.Ky=p;this.oi=0;this.rE=q;this.jN=p;this.fm=this.WK="";this.uj=new nc(F.pa+"spotmkrs.png",new L(18,18),{anchor:new L(9,9),imageOffset:new L(0,0),infoWindowOffset:new L(10,0)});this.iE()};Gh=Sa.prototype; Gh.iE=function(){var a=this;a.PU();a.bind();a.Va=o;setTimeout(function(){a.In()},1E3);setInterval(function(){a.rE=q},300)};Gh.u4=ca(q);Gh.bind=function(){this.eV();this.fV();this.gV();this.hV()};Gh.hV=function(){var a=this,b=this.map;b.addEventListener("vectorchanged",function(c,d){d.isvector?a.close():b.K.nj==o&&a.open()})}; Gh.GY=function(a){var b=this.map;if(this.Va)if(10>b.fa())this.cm();else if(this.hC(),a&&a.point)if(this.oi&&(this.jN=a.point),this.rE=o,1!=this.oi&&(this.be&&this.be.U(),this.ce&&this.ce.U(),this.Jd&&this.Jd.U()),a=b.HX(a.point,b.fa()),a.py&&a.Gw&&a.vg)this.fm=a.vg+"_"+a.py+"_"+a.Gw,this.Co[a.vg+"_"+a.py+"_"+a.Gw]?this.CF!=this.fm&&this.FG(this.fm):this.HZ({yE:a.vg,x:a.py,y:a.Gw})}; Gh.FG=function(a){var b=this.map;if(b.oa()!=La&&b.oa()!=Ra)this.cm(),this.Ak();else if(b=a.split("_"),b=b[0]+"_"+b[1]+"_"+b[2],this.Co[b]){this.cm();this.TE=this.IJ(this.Co[b][a]?this.Co[b][a]:[],"MAP_CLICK_POI");this.CF=a;for(var a=-1,c=0,d=this.am.length;cthis.map.fa())for(var b=0,c=a.spots.length;bb.fa())&&a&&(this.oi=0,this.Pk&&(b.R.nb&&b.R.nb.close(),this.ti=a,this.KZ(this.Pk)))};Gh.KZ=function(a){if(a){var b=this;$c.ab(function(c){b.VR(a,c)},{qt:"inf",uid:a,operate:"mapclick",clicktype:"tile"})}}; Gh.VR=function(a,b){var c=this,d=this.map;if(b&&b.content){var e=b.content,f=e.pano||0;P.tb(e.geo,o);if(!g)var g={};g.isFromMPC=o;var i=e.addr,g=e.street_id||"";if(1==e.poiType||3==e.poiType)i=P.unique(i.split(";")).join("; ");var k=e.tel;k&&(k=k.replace(/,/g,", "));c.Tq(e.cla);var l=K("div",{style:"font-size:12px;padding:5px 0;overflow:hidden;*zoom:1;"}),m=q;f&&(360>c.map.height?m=o:(f=[],f.push("
"), f.push("\'"+e.name+"\\u5916\\u666f\'"),f.push("
\\u8fdb\\u5165\\u5168\\u666f>>"),f.push("
"),l.innerHTML= f.join("")));i&&(f=K("p",{style:"padding:0;margin:0;line-height:18px;font-size:12px;color:#4d4d4d;"}),f.innerHTML="\\u5730\\u5740\\uff1a"+i,l.appendChild(f));k&&(i=K("p",{style:"padding:0;margin:0;line-height:18px;font-size:12px;color:#4d4d4d;"}),i.innerHTML="\\u7535\\u8bdd\\uff1a"+k,l.appendChild(i));e.tag&&(k=K("p",{style:"padding:0;margin:0;line-height:18px;font-size:12px;color:#4d4d4d;color:#7f7f7f;"}),k.innerHTML="\\u6807\\u7b7e\\uff1a"+e.tag,l.appendChild(k));var k="http://api.map.baidu.com/place/detail?uid="+ a+"&output=html&source=jsapi&operate=mapclick&clicktype=tile",i="
"+e.name+"",n=new qc(l,{width:322,enableSearchTool:o,title:i+("\\u8be6\\u60c5»")+ "
",enableParano:m});m&&(n.street_id=g);n.addEventListener("open",function(){var a=x.$("panoInfoBox");if(a){var b=e.street_id||"";Ob(function(){Pa(6006);c.Bq(b)},a,"pano_thumnail_img|panoInfoBoxTitleBg|panoInfoBoxTitleContent")}a=x.$("detailDiv");Ob(function(){Pa(6001)},a,"detailInfo")});n.addEventListener("close",function(){c.be&&c.be.U();c.ce&&c.ce.U();c.Jd&&c.Jd.U();d.R.nb.$a&&d.R.nb.$a.U();Fh=c.ti=p;n.removeEventListener("close",arguments.callee)});c.ti?(c.ti.Mb(n),Fh||(Fh=c.Pk+"|"+(c.Am? c.Am:c.jp))):c.ve||(g=P.tb(e.geo,o).point,c.Am&&(l=Hh[c.Am],c.uj.Mt(new L(l.x,l.y)),l=Ih[l.W],c.uj.xe(new L(l.a,l.Za)),c.uj.qc(new L(l.a/2,l.Za/2))),c.ve=new T(g,{icon:c.uj,zIndexFixed:o}),d.Ia(c.ve),c.ve.addEventListener("click",function(){Fh=c.Pk+"|"+(c.Am?c.Am:c.jp);c.lC(c.ve)}),c.ve.addEventListener("mouseout",function(){c.OM(c.ve)}),c.ve.Mb(n));c.be&&c.be.U();c.ce&&c.ce.U();c.Jd&&c.Jd.U()}}; Gh.Bq=function(a){var b=z.tg("pano","scape/")[0],c=this,d=(new Date).getTime(),e="Pano"+d;z[e]=function(a){var b=c.map.rm(),a=a.content[0];b.rc(a.poiinfo.PID);b.show();b.Nc({heading:a.poiinfo.Dir,pitch:a.poiinfo.Pitch})};d=(new Date).getTime();Qb(b+("?qt=poi&udt=20131021&uid="+a+"&t="+d+"&fn=BMap."+e),q)}; Gh.JY=function(a){var b=this.map;if(!(10>b.fa())){var c=a.spots;if(c&&!(1>c.length||"MAP_CLICK_POI"!=c[0].tag)){var d=this,e=p,f=p,g=0;d.ti&&d.ti===d.ve?(e=d.Om,f=d.ce,g=2):(e=d.ve,f=d.be,g=1);if(!b.R.nb||!(b.R.nb.Va()==o&&Fh&&c[0].Ve.uid==Fh.split("|")[0])){if(c[0].Ve.type&&Hh[c[0].Ve.type]){var i=Hh[c[0].Ve.type];d.jp=c[0].Ve.type}else i=Hh.blank,d.jp="blank";var k=Ih[i.W];d.uj.xe(new L(k.a,k.Za));d.uj.qc(new L(k.a/2,k.Za/2));d.uj.Mt(new L(i.x,i.y));k=c[0].Ve.TL?c[0].Ve.TL:c[0].m;e&&e.map?(e.U(), e.sa(k),e.Tb(d.uj),e.show(),d.Pk=c[0].Ve.uid):(e=new T(k,{icon:d.uj,zIndexFixed:o,baseZIndex:3E6}),d.Pk=c[0].Ve.uid,b.Ia(e),1==g?d.ve=e:d.Om=e,e.addEventListener("click",function(){d.Am=d.jp;Fh=d.Pk+"|"+d.jp;d.lC(e)}),e.addEventListener("mouseout",function(){d.OM(e)}));e.zi(o);i=[{backgroundColor:"#FFFFE1",borderColor:"#8C8C8C",color:"#4D4D4D"},{backgroundColor:"#F0F7FF",borderColor:"#7AA3CC",color:"#224B73"}];d.Ky=e;f&&f.map?(f.U(),c[0].Ve.name?(d.oi=1,f.bd(c[0].Ve.name),a=d.kx(k,1,{x:Math.abs(c[0].v[0])+ 6,y:-9}),f.sa(a),f.Kd(i[1]),f.show()):(d.oi=2,f.bd("\\u70b9\\u51fb\\u53ef\\u67e5\\u770b\\u8be6\\u60c5"),f.Kd(i[0]),d.mO(f))):c[0].Ve.name?(d.oi=1,a=d.kx(k,1,{x:Math.abs(c[0].v[0])+6,y:-9}),f=new rc(c[0].Ve.name,{position:a}),b.Ia(f),1==g?d.be=f:d.ce=f,f.Kd(i[1])):(d.oi=2,f=new rc("\\u70b9\\u51fb\\u53ef\\u67e5\\u770b\\u8be6\\u60c5",{position:d.kx(a.point,0)}),b.Ia(f),f.U(),1==g?d.be=f:d.ce=f,f.Kd(i[0]),d.mO(f))}}}}; Gh.mO=function(a){var b=this;b.qn=setInterval(function(){b.rE||setTimeout(function(){if(2==b.oi){var c=b.kx(b.jN,0);a.sa(c);a.show()}clearInterval(b.qn)},500)},200)};Gh.kx=function(a,b,c){var d=this.map,a=d.ac(a);if(c)var e=c;else 0==b?e={x:-1,y:24}:1==b&&(e={x:12,y:-9});try{if(0==b||1==b)return d.ub(new Q(a.x+e.x,a.y+e.y))}catch(f){}}; Gh.IY=function(){var a=this.map;if(!(10>a.fa())){this.oi=0;this.be&&this.be.U();this.ce&&this.ce.U();this.Jd&&this.Jd.U();this.qn&&clearInterval(this.qn);this.Ky=p;var b=this.Om;if(b&&b.map&&(!a.R.nb||a.R.nb.Va()==q||a.R.nb.$a!==b)){if(this.ti&&this.ti===b)return;b.U()}(b=this.ve)&&b.map&&((!a.R.nb||a.R.nb.Va()==q||a.R.nb.$a!==b)&&!(this.ti&&this.ti===b))&&b.U()}}; Gh.OM=function(a){var b=this.map;!(10>b.fa())&&a&&(this.be&&this.be.U(),this.ce&&this.ce.U(),this.Jd&&this.Jd.U(),this.ti!==a&&!(b.R.nb&&b.R.nb.Va()==o)&&(this.Pk=""))}; Gh.eV=function(){var a=this,b=this.map;b.addEventListener("load",function(){a.In()});b.addEventListener("moveend",function(){a.In()});b.addEventListener("dragend",function(){a.In()});b.addEventListener("zoomend",function(){a.hC();a.cm();if(!b.R.nb||b.R.nb.Va()!=o)a.ve&&a.ve.U(),a.Om&&a.Om.U(),a.be&&a.be.U(),a.ce&&a.ce.U(),a.Jd&&a.Jd.U(),a.oi=0,a.qn&&clearInterval(a.qn);a.In()});b.addEventListener("resize",function(){a.In()})}; Gh.In=function(){var a=this.map;this.Va&&10>a.fa()&&(this.cm(),this.Dw||(this.Dw=this.IJ(Jh,"MAP_CLICK_CITY")))};Gh.HZ=function(a){var b=this.map,c=this.map.ba;if(a&&this.WK!=a.yE+"_"+a.x+"_"+a.y){this.WK=a.yE+"_"+a.x+"_"+a.y;var d=[];d.push(z.url.proto+z.url.domain.TILE_ONLINE_URLS[Math.abs(a.x+a.y)%3]+"/js/?qt=vQuest&styles=pl");d.push("&x="+a.x+"&y="+a.y+"&z="+b.Ka+"&v=056&fn=MPC_Mgr."+c+".getPoiData");Qb(d.join(""))}}; Gh.getPoiData=function(a){var b=a.content[0],c=this.map;if(!(0b.uids.length)){for(var d={},a=q,e=[],f=0,g=b.uids.length;fthis.EY&&(d=this.am.shift(),delete this.Co[d],delete d);a&&this.FG(this.fm)}};Gh.cm=function(){var a=this.map;this.TE&&(a.bm("MAP_CLICK_POI"),this.TE=p,this.fm=this.CF="")};Gh.hC=function(){var a=this.map;this.Dw&&(a.bm("MAP_CLICK_CITY"),this.Dw=p)}; Gh.Ak=function(){this.ve&&this.ve.U();this.Om&&this.Om.U();this.be&&this.be.U();this.ce&&this.ce.U();this.Jd&&this.Jd.U();this.qn&&clearInterval(this.qn)};Gh.Tq=function(a){for(var b=[],c=0,d=a.length;c