You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
10 KiB
2 lines
10 KiB
/**/_jsload2&&_jsload2('tile', 'function lg(){this.Dd=this.ep=this.So=this.yj=s;this.BD=t;this.Nh=s}z.lang.wa(lg,mc,"MobileInfoWindow"); z.extend(lg.prototype,{initialize:function(a){this.M=a;this.Nh=document.createElement("div");this.Nh.className="iw";this.Nh.style.cssText="position:absolute; line-height:28px; text-align:center; border:0px;";var b=this.yj=document.createElement("div");this.Nh.appendChild(b);this.So=document.createElement("div");this.So.className="iw_l";b.appendChild(this.So);this.ep=document.createElement("div");this.ep.className="iw_r";b.appendChild(this.ep);this.Zj=document.createElement("a");this.Zj.setAttribute("target", "_blank");this.Zj.className="iw_s iw_s0 iw_c";this.Zj.innerHTML="<div class=\'iw_bg iw_cc\'></div>";b.appendChild(this.Zj);a.Mf().BC.appendChild(this.Nh);this.bind();this.Dd=this.Zj.getElementsByTagName("DIV")[0];this.So.style.display="block";this.ep.style.display="block";return this.Nh},bind:function(){var a=this;z.V(a.So,"click",function(b){a.vY();b.preventDefault();b.stopPropagation()});z.V(a.ep,"click",function(b){a.cY();b.preventDefault();b.stopPropagation()});z.V(a.Zj,"click",function(a){a.stopPropagation()}); z.Nb("touchstart touchmove touchend gesturestart gesturechange mousedown mouseout mouseover click mousewheel keydown selectstart".split(" "),function(b){z.V(a.Zj,b,na);z.V(a.So,b,na);z.V(a.ep,b,na)})},bI:u(),RH:u(),ja:function(){return new J(this.nH.lng,this.nH.lat)},ua:u(),Za:x("BD"),aa:function(){z.R.aa(this.ba);this.Nh.style.display="none";this.BD=t},show:function(a){a&&(this.point=a);z.R.show(this.ba);this.Nh.style.display="block";this.BD=p;this.M.$.rb=this},DZ:function(){var a=this.M,b=this.Gh, c=this.yj.offsetWidth,e=this.yj.offsetHeight,f=a.Hb(),c=c/2+16,e=e/2+78;if(this.Gh){var g=new R(0,0);b.x<c?g.x=c-b.x:f.width-b.x-8<c&&(g.x=f.width-b.x-8-c);b.y<e?g.y=e-b.y:60>f.height-b.y&&(g.y=f.height-b.y-60);0==g.x&&0==g.y||a.tg(g.x,g.y)}},switchTo:function(a){this.Gh=a.point;this.jd=a.name;this.Vj=a.uid;this.Nj=a.Da;this.qS=parseInt(this.M.platform.style.left);this.rS=parseInt(this.M.platform.style.top);this.nH=this.M.Ib(this.Gh);this.show();this.fZ();this.bN()},w4:function(){this.yj.className= "iw_rt";this.show();this.bN()},fZ:function(){this.Zj.setAttribute("href","http://map.baidu.com/place/detail?uid="+this.Vj+"&output=html&source=jsapi&operate=mapclick&clicktype=vector");this.yj.className="iw_rt";this.Dd.innerHTML="<div class=\'iw_poir\'><div class=\'crl_ar\' style=\'white-space:nowrap;text-overflow:ellipsis;overflow:hidden;\'>"+this.jd+"</div></div>";this.draw()},bN:function(){var a=this;a.rD||(a.rD=setTimeout(function(){a.DZ();clearTimeout(a.rD);a.rD=s},100))},x5:function(){var a=$("popList"); 43<this.Dd.textContent.length&&(58<=this.Dd.textContent.length?a.eb("zoom2"):a.eb("zoom1"))},F1:function(){this.Dd.innerHTML=""},draw:function(){if(this.Gh){var a=this.Gh,b=a.y;this.Nh.style.left=a.x-98-this.qS+"px";this.Nh.style.top=b-62-this.rS+"px"}},y3:function(){Xa()&&(location.href="http://map.baidu.com/detail?qt=ninf&wd=&detail=scope&uid="+this.Vj);I()&&(location.href="http://map.baidu.com/mobile/#place/detail/qt=inf&c=131&uid="+this.Vj)},vY:function(){this.M.Ib(this.Gh);var a=this.M.ka(), a=Math.pow(2,18-a),b=this.M.Hb(),c=this.M.fc,a="http://map.baidu.com/mobile/?third_party=uri_api#index/searchnearby/foo=bar/"+this.$X({nb_x:c.lng+a*(this.Gh.x-b.width/2),nb_y:c.lat-a*(this.Gh.y-b.height/2),center_name:this.jd,from:"searchnearby"});window.open(a,"_blank")},cY:function(){var a=this.M.Tg,b=this.M.Nd()?"&operate=vectorclick":"&operate=mapclick",a=D.Cd+"direction?origin=\\u6211\\u7684\\u4f4d\\u7f6e&destination="+this.jd+"&mode=navigation&output=html&src=jsapi"+b+"®ion="+a;Ta("navlinkmobile"); window.open(a,"_blank")},$X:function(a){if(!a)return"";var b=[],c;for(c in a)b.push(c+"="+encodeURIComponent(a[c]));return b.join("&")}});D.p0=lg;z.extend(Jc.prototype,{YO:function(){this.QF(this.map);this.To(0)},uD:function(a){this.Ot=new Kc(this);this.Ot.Me(new Lc(this.map,this.Ot,a.Te))},To:function(){this.map.ka();this.loaded||(this.ax(),this.loaded=p);this.Rf()},xa:function(){var a=this,b=a.map;b.addEventListener("loadcode",function(){a.To()});b.addEventListener("addtilelayer",function(b){a.Me(b)});b.addEventListener("removetilelayer",function(b){a.Tf(b)});b.addEventListener("setmaptype",function(b){a.wg(b)});b.addEventListener("zoomstartcode", function(){a.Kc()});a.map.addEventListener("setcustomstyles",function(b){a.kt(b.target);a.Rf(p)});b.addEventListener("initindoorlayer",function(b){a.uD(b)});a.QF(b)},QF:function(a){var b=this;a.addEventListener("mousewheel",function(a){b.mY(a)});a.addEventListener("dblclick",function(a){b.zJ(a)});a.addEventListener("rightdblclick",function(a){b.zJ(a)});a.addEventListener("minuspress",function(a){b.uL(a)});a.addEventListener("pluspress",function(a){b.uL(a)});a.addEventListener("moving",function(){b.Rf()}); a.addEventListener("resize",function(){b.map.Nd()||b.Rf()});b.map.addEventListener("setcustomstyles",function(){b.bv()});a.addEventListener("onvectorloaded",function(){a.Nd()&&(b.bv(),b.hg.style.visibility="")})},U0:function(){this.Q_=new window.VectorLayer(this.map.U.we);this.map.Me(this.Q_)},Me:function(a){var b=this,c=a.target;b.map.Nd();c.Nm&&this.map.Me(c.Nm);if(c.gx){for(a=0;a<b.xg.length;a++)if(b.xg[a]===c)return;K.load("vector",function(){c.xa(b.map,b.hg);b.xg.push(c)},p)}else{for(a=0;a<b.Uf.length;a++)if(b.Uf[a]=== c)return;b.Uf.push(c);c.xa(this.map,this.ml);b.map.loaded&&b.Rf()}},Tf:function(a){a=a.target;this.map.Nd();a.Nm&&this.map.Tf(a.Nm);if(a.gx){for(var b=0,c=this.xg.length;b<c;b++)a===this.xg[b]&&this.xg.splice(b,1);a.remove()}else{var c=this.rg,e=this.Si;for(b in e){var f=b.split("-")[1];f===a.ea+""&&delete e[b]}for(b in c)f=b.split("-")[1],f===a.ea+""&&delete c[b];b=0;for(c=this.Uf.length;b<c;b++)a===this.Uf[b]&&this.Uf.splice(b,1);a.remove();this.Rf()}},mY:function(a){var b=this.map;if(b.U.vo){var c= b.tn(b.Va+(a.xp===p?1:-1));c.yC||(b.dispatchEvent(new Q("onzoomstart")),b.Bc=b.Va,b.Va=c.zoom,a=a.mb,c=this.uz(a),zoomUnits=b.va().dc(b.ka()),b.fc=new J(c.lng+(b.width/2-a.x)*zoomUnits,c.lat-(b.height/2-a.y)*zoomUnits),b.pe=b.Pc.eh(b.fc,b.Vb),this.zoom(a))}},zJ:function(a){var b=this.map;if(b.U.mC){var c=a.mb,e=1,f=c,g=new P(0,0);"onrightdblclick"===a.type&&(e=-1,f=new R(b.width/2,b.height/2));a=b.tn(b.Va+e);a.yC?1===e&&(c=b.Ib(c),b.ji(c)):(b.dispatchEvent(new Q("onzoomstart")),b.Bc=b.Va,b.Va=a.zoom, 1===e&&(b.fc=this.uz(c),b.pe=b.Pc.eh(b.fc,b.Vb),e=0.5*(b.va().dc(b.Bc)/b.va().dc(a.zoom)),g.width=c.x-Math.round(b.width/2)*e,g.height=c.y-Math.round(b.height/2)*e),this.zoom(f,g));I()&&(b=b.$g())&&b.aa()}},uL:function(a){var b=this.map;if(b.U.to){if(!this.Lh){var c=b.tn(b.Va+("onpluspress"===a.type?1:-1));c.yC||(b.dispatchEvent(new Q("onzoomstart")),a=new R(b.width/2,b.height/2),b.Bc=b.Va,b.Va=c.zoom,b.$g()&&(a=b.Rb(b.$g().ja(),b.Bc),c=b.Ib(a,b.Bc),b.Wj(b.width/2-a.x,b.height/2-a.y,c,p)),this.zoom(a))}}else"onpluspress"=== a.type?b.hF():b.iF()},uz:function(a){var b=this.map,c=b.fc,e=b.va().dc(b.Bc);return new J(c.lng+e*(a.x-b.width/2),c.lat-e*(a.y-b.height/2))},zoom:function(a,b){var c=this,e=c.map,f=e.Va,g=e.U.bF,i=f>g?p:t;if(f<e.Bc&&(f===g||f===g-1))i=p;var k=b?b.width:0,m=b?b.height:0,e=this.map,g=e.U,c=this,n=a.x-parseInt(i?c.fy.style.left:c.hc.style.left,10)-e.offsetX,o=a.y-parseInt(i?c.fy.style.top:c.hc.style.top,10)-e.offsetY;e.Oc&&z.R.aa(e.Oc);c.ml.style.visibility="hidden";c.hg&&(c.hg.style.visibility="hidden"); this.iT(i);c.An.style.visibility="hidden";this.Hg.style.visibility="hidden";var q=[],i=e.Va-e.Bc;c.gq?0<e.Va-e.Bc?c.gq++:c.gq--:c.gq=i;this.Lh&&0===this.Lh.Nx&&(this.Lh.stop(),this.Lh=s,i=c.gq);if((!b||0===b.width&&0===b.height)&&g.to)e.$.d0.action(a,0<i?p:t);var i=Math.pow(2,i),v=this.ud,w=v.style;w.visibility="";if(e.U.uo)if(this.Hg.style.visibility="visible",w.visibility="hidden",g=z.platform.jj&&2.3<parseFloat(z.platform.mB)?p:t,z.platform.jj&&!g)e.dispatchEvent(new Q("onzoomend"));else{if(f!== e.Bc){var y=f>e.Bc?p:t;if(c.sL!==p){c.sL=p;var A=e.platform.style,g=e.offsetX,n=e.offsetY,o=e.width,f=e.height,B=a?a.x-g:o/2-g,C=a?a.y-n:f/2-n;A.WebkitTransformOrigin=B+"px "+C+"px";b=new P(0,0);new ub({duration:300,$b:vb.gC,Hc:30,za:function(a){var c=y?1+a:1-a/2;A.WebkitTransformOrigin=B+"px "+C+"px";A.WebkitTransform="translate3d("+-b.width*a+"px, "+-b.height*a+"px,0px) scale("+c+")"},finish:function(){e.Oc&&setTimeout(function(){z.R.show(e.Oc)},100);e.dispatchEvent(new Q("onzoomend"));A.WebkitTransform= "";c.sL=t}})}}}else{for(f=v.children.length-1;-1<f;f--){var F={},E=v.children[f].style;F.top=parseInt(E.top)||0;F.left=parseInt(E.left)||0;F.width=parseInt(E.width);F.height=parseInt(E.height);F.JV=F.width*i-F.width;F.kV=F.height*i-F.height;F.df=(F.left-n)*i-(F.left-n);F.ef=(F.top-o)*i-(F.top-o);q[f]=F;E.display="block"}v.iS=parseInt(v.style.left);v.mS=parseInt(v.style.top);this.Lh&&(this.Lh.stop(),this.Lh=s);this.Lh=new ub({Hc:20,duration:g.to?g.e0:1,$b:vb.hC,za:function(a){if(!(a<0.1)){for(var b= q.length-1;b>-1;b--){var c=q[b];if(v.children[b]){var e=v.children[b].style;e.top=Math.round(c.top+c.ef*a)+"px";e.left=Math.round(c.left+c.df*a)+"px";e.width=Math.ceil(c.width+c.JV*a)+"px";e.height=Math.ceil(c.height+c.kV*a)+"px"}}if(k||m){w.left=v.iS-k*a+"px";w.top=v.mS-m*a+"px"}}},finish:function(){c.Rf();e.Oc&&(z.ga.ma&&z.ga.ma<8||document.compatMode==="BackCompat"?z.R.show(e.Oc):setTimeout(function(){z.R.show(e.Oc)},100));c.ml.style.visibility="";c.An.style.visibility="";c.Hg.style.visibility= "";delete c.gq;e.dispatchEvent(new Q("onzoomend"));setTimeout(function(){if(c.hg)c.hg.style.visibility="";c.bv()},10);v=s;c.Lh=s}})}},wg:function(){var a=this,b=a.map;b.addEventListener("tilesloaded",function(){setTimeout(function(){a.bv()},200);b.removeEventListener("tilesloaded",arguments.callee)});for(var c in this.rg)this.Xw(this.rg[c]);for(c in this.Si)this.Xw(this.Si[c]);c=this.mm;for(var e=0,f=c.length;e<f;e++)c[e].remove();delete this.hc;this.mm=[];this.Si=this.rg={};this.ax();this.Rf()}, iT:function(a){var b=this.map,a=a||t;if(this.ud)this.ud.parentNode&&!this.Lh&&(this.ud.parentNode.removeChild(this.ud),this.ud=s,this.ud=a?this.fy.cloneNode(p):this.hc.cloneNode(p));else if(a){this.ud=this.fy.cloneNode();for(var a=this.fy.childNodes,c=0,e=a.length;c<e;c++){var f=a[c].cloneNode(p);f.style.display="none";f.getContext("2d").drawImage(a[c],0,0);this.ud.appendChild(f)}}else this.ud=this.hc.cloneNode(p);a=this.ud;c=a.style;c.display="";c.zIndex-=100;b.platform.insertBefore(a,b.platform.firstChild)}, bv:function(){this.ud&&(Sc(this.ud),this.ud.parentNode&&(this.ud.parentNode.removeChild(this.ud),this.ud.innerHTML="",this.ud=s))}}); ');
|