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.

1 line
8.0 KiB

/**/_jsload2 && _jsload2('buslinesearch', 'x.extend(Ne.prototype,{Td:function(){for(var a=0,b=this.Pa.length;a<b;a++){var c=this.Pa[a];this[c.method].apply(this,c.arguments)}delete this.Pa},Ev:function(a,b,c){a=T.tb(a);return B.Rp+"?c="+a.lng+","+a.lat+"&i="+b+","+encodeURIComponent(c)+"&s="+encodeURIComponent("tpl:LinesQuery")},getBusList:function(a){var b=this;this.Pg(this.Ad,function(c){c?de.eb(function(a,c){b.$Q(a,c)},{qt:b.nQ,c:c,wd:a},{wb:a}):(this.uc=new Ri({wb:a,city:"",xi:"",Kh:""}),b.sb(5),b.Ra(Y.Wu,this.uc))})},$Q:function(a,b){this.clearResults(); var c=a.result;if(!a.content||0!=c.error||c.type!=this.pQ)this.uc=new Ri({wb:b.wb,city:a.current_city.name,xi:"",Kh:a.current_city.code}),this.sb(7),this.Ra(Y.Wu,this.uc);else{for(var c=a.content,d=[],e=0,f=c.length;e<f;e++)d.push({name:c[e].name,ok:c[e].uid,Kh:a.current_city.code,$j:e,mB:b.wb,Yi:c[e].poiType||2});this.uc=new Ri({wb:b.wb,city:a.current_city.name,xi:this.Ev(Q.kb(a.current_city.geo,o).point,a.current_city.code,b.wb),hN:d,Kh:a.current_city.code});this.sb(0);this.Ra(Y.Wu,this.uc);this.yU(); this.zT(a.current_city.geo,a.current_city.level,a.current_city.code)}},yU:function(){if(this.k.ja.Ia&&this.k.ja.Ia.appendChild&&this.uc&&0<this.uc.xt()){var a=H("div",{style:"font:12px "+I.fontFamily+";background:#fff"});a.id="divResult"+this.ba;for(var b=this.uc.xt(),c=[],d=0;d<b;d++){var e=this.uc.hE(d).name;c.push(\'<dl style="margin:3px 3px"><dt><span style="cursor:pointer" onclick=Instance(\\\'\'+this.ba+"\')._selectBusListItem("+d+")><img id=imgBLIcon"+d+" src="+Ne.Nv+\' style="border:none" /></span>&nbsp;&nbsp;<a style="color:blue" href="javascript:void(0)" onclick=Instance(\\\'\'+ this.ba+"\')._selectBusListItem("+d+")>"+e+"</a></dt><dd id=ddBLInfo"+d+\' style="display:none;margin:2px 0px"></dd></dl>\')}b="";this.uc.moreResultsUrl&&(b=b+"<div style=\'color:#7777cc;background:#e5ecf9;overflow:hidden;padding:2px;text-align:right\'>"+("<a style=\'color:#7777cc\' href=\'"+this.uc.moreResultsUrl+"\' target=\'_blank\'>\\u5230\\u767e\\u5ea6\\u5730\\u56fe\\u67e5\\u770b&#187;</a>"),b+="&nbsp;</div>");a.innerHTML=c.join("")+b;this.k.ja.Ia.appendChild(a);this.Ra(Y.PG,a)}},zT:function(a,b,c){var d=this.k.ja.map; d&&(a=Q.kb(a,o).point,this.JB?this.JB!=c&&(d.Gd(a,b),this.JB=c):(d.Gd(a,b),this.JB=c))},lV:function(a){if(this.uc)for(var b=0,c=this.uc.xt();b<c;b++){var d=x.Ec("ddBLInfo"+b),e=x.Ec("imgBLIcon"+b);b==a?"none"==d.style.display?(d.style.display="block",e.src=Ne.rT):(d.style.display="none",e.src=Ne.Nv):(d.style.display="none",e.src=Ne.Nv)}},_selectBusListItem:function(a,b){if(!b){var c=x.Ec("ddBLInfo"+a),d=x.Ec("imgBLIcon"+a);if("block"==c.style.display){c.style.display="none";d.src=Ne.Nv;return}}if(this.uc&& this.uc[a]&&0<this.uc[a].vp())this.Fc=this.uc[a],this.sb(0),this.Ra(Y.Vu,this.Fc),this.sJ(a),this.rJ(a);else{var e=this,c=this.uc.hE(a);de.eb(function(b,c){e.ZQ(b,c,a)},{qt:e.mQ,c:c.Kh,uid:c.ok},{name:c.name,Yi:c.Yi})}},clearResults:function(){delete this.uc;delete this.Fc;delete this.aj;delete this.i2;this.Sj();this.k.ja.Ia&&(this.k.ja.Ia.innerHTML="")},getBusLine:function(a){a&&("object"==typeof a&&a.ok&&""!=a.ok&&"undefined"!=typeof a.Kh&&""!=a.Kh.toString()&&"undefined"!=typeof a.$j&&""!=a.$j.toString()&& "undefined"!=typeof a.mB&&""!=a.mB.toString())&&(this.uc&&0<this.uc.xt()&&a.Kh==this.uc.Kh&&a.mB==this.uc.keyword)&&this._selectBusListItem(a.$j,o)},ZQ:function(a,b,c){var d=a.result;if(!a.content||!a.content[0]||0!=d.error||d.type!=this.oQ)this.Fc=new Si({name:b.name}),this.sb(7),this.Ra(Y.Vu,this.Fc);else{var a=a.content[0],e=d="",f="",g={},i=[],d=a.startTime,e=a.endTime,f=a.company;a.geo&&(g=Q.kb(a.geo,o),g=new Dd(g.ha));if(a.stations)for(var j=0,l=a.stations.length;j<l;j++)if(a.stations[j].geo){var m= Q.kb(a.stations[j].geo,o);i.push({name:a.stations[j].name,position:m.point,ok:a.stations[j].uid})}this.Fc=new Si({name:b.name,startTime:d,rX:e,tW:f,YZ:g,XO:i,Yi:b.Yi});this.sb(0);this.Ra(Y.Vu,this.Fc);this.uc[c]=this.Fc;this.sJ(c);this.rJ(c)}},sJ:function(a){if(this.k.ja.Ia&&this.k.ja.Ia.appendChild&&this.Fc&&0<this.Fc.vp()){this.lV(a);var b=x.Ec("ddBLInfo"+a);if(b){var c=[];c.push(\'<table style="width:100%;background:#CDCDCD;font:12px \'+I.fontFamily+\'" cellspacing="1" cellpadding="1" ><tbody>\'); c.push(\'<tr><td style="width:95px;line-height:22px;padding:0px 8px;text-align:left;vertical-align:top;background:#F4F4F4" >\\u9996\\u672b\\u8f66\\u65f6\\u95f4</th><td style="background:#FFFFFF;line-height:22px;padding:0px 8px" >\'+this.Fc.startTime+"-"+this.Fc.endTime+"</td></tr>");c.push(\'<tr><td style="width:95px;line-height:22px;padding:0px 8px;text-align:left;vertical-align:top;background:#F4F4F4" >\\u6240\\u5c5e\\u516c\\u53f8</th><td style="background:#FFFFFF;line-height:22px;padding:0px 8px" >\'+this.Fc.company+ "</td></tr>");c.push("</tbody></table>");4==this.Fc.Yi?c.push(\'<p style="margin:2px 0px;font:12px \'+I.fontFamily+\';">\\u6cbf\\u7ebf\\u5730\\u94c1\\u7ad9:</p>\'):c.push(\'<p style="margin:2px 0px;font:12px \'+I.fontFamily+\';">\\u6cbf\\u7ebf\\u516c\\u4ea4\\u7ad9\\u70b9:</p>\');c.push(\'<table style="width:100%;font:12px \'+I.fontFamily+\';" ><tbody>\');for(var d=0,e=this.Fc.vp();d<e;d++)c.push(\'<tr><td style="width:20px">\'+(d+1)+"</th><td><a id=aStop_"+a+"_"+d+\' style="color:blue" href="javascript:void(0)" onclick=Instance(\\\'\'+ this.ba+"\')._selectBusStop("+a+","+d+")>"+this.Fc.Kx(d).name+"</a></td></tr>");c.push("</tbody></table>");b.innerHTML=c.join("")}a=x.Ec("divResult"+this.ba);this.Ra(Y.OG,a)}},rJ:function(a){if(this.k.ja.map&&this.Fc&&0<this.Fc.vp()){this.Sj();X.fm(this.k.ja.map,this.Fc.ve());var b=this.Fc.yp();this.Ra(Y.Xu,b);var c=this;this.aj=[];for(var d=0,e=this.Fc.vp();d<e;d++){var f=this.Fc.Kx(d).position,g=this.Fc.Kx(d).name,f=X.HV(this.k.ja.map,f,g);(function(b,d,e){b.addEventListener("click",function(f){var g= ["<div style=\'font:12px "+I.fontFamily+"\'>"];g.push("<div style=\'margin:10px 1em 24px 0\'><b>"+d+"</b></div>");g.push("</div>");var s=new td(g.join(""),{title:"",height:0,width:220,margin:[10,10,20,10]});s.addEventListener("open",function(){var b=x.Ec("aStop_"+a+"_"+e);b&&(b.style.backgroundColor="#cccccc")});s.addEventListener("close",function(){var b=x.Ec("aStop_"+a+"_"+e);b&&(b.style.backgroundColor="#ffffff")});g=c.k.ja.map;g.B.Dm?ef.Ip(s,g.getCurrentCity().code,{panoInstance:g.P,lngLat:f.target.ia(), titleTip:d,type:"busline"},function(){b.Mb(s)}):b.Mb(s)})})(f,g,d);f.eC=g;this.aj.push(f)}this.Ra(Y.zq,this.aj);this.k.ja.bh&&this.k.ja.map.Dh(b.ve(),{margins:[5,5,5,5]})}},_selectBusStop:function(a,b){if(this.k.ja.map&&this.aj&&0<this.aj.length){var c=this.aj[b];if(c.eC){var d=["<div style=\'font:12px "+I.fontFamily+"\'>"];d.push("<div style=\'margin:10px 1em 24px 0\'><b>"+c.eC+"</b></div>");d.push("</div>");var e=new td(d.join(""),{title:"",height:0,width:220,margin:[10,10,20,10]});e.addEventListener("open", function(){var c=x.Ec("aStop_"+a+"_"+b);c&&(c.style.backgroundColor="#cccccc")});e.addEventListener("close",function(){var c=x.Ec("aStop_"+a+"_"+b);c&&(c.style.backgroundColor="#ffffff")});d=this.k.ja.map;d.B.Dm?ef.Ip(e,d.getCurrentCity().code,{panoInstance:d.P,lngLat:c.ia(),titleTip:c.eC,type:"busline"},function(){c.Mb(e)}):c.Mb(e)}}else{this.gO&&(this.gO.style.backgroundColor="#ffffff");if(d=x.Ec("aStop_"+a+"_"+b))d.style.backgroundColor="#cccccc";this.gO=d}},Sj:function(){this.k.ja.map&&this.k.ja.map.RK()}, sb:function(a){"number"==typeof a?this.Dd=a:delete this.Dd}});function Ri(a){this.keyword=a.wb||"";this.city=a.city;this.moreResultsUrl=a.xi;this.pB=a.hN&&a.hN.slice(0)||[];this.Kh=a.Kh}x.extend(Ri.prototype,{hE:function(a){if(this.pB[a])return this.pB[a]},xt:function(){return this.pB.length}});var Ti=Ri.prototype;U(Ti,{getNumBusList:Ti.xt,getBusListItem:Ti.hE});function Si(a){this.name=a.name||"";this.startTime=a.startTime||"";this.endTime=a.rX||"";this.company=a.tW||"";this.Zi=a.YZ||{};this.gC=a.XO&&a.XO.slice(0)||[];this.Yi=a.Yi||2}x.extend(Si.prototype,{Kx:function(a){if(this.gC[a])return this.gC[a]},vp:function(){return this.gC.length},yp:v("Zi"),ve:function(){if(this.Zi.ve())return this.Zi.ve()}});var Ui=Si.prototype;U(Ui,{getNumBusStations:Ui.vp,getBusStation:Ui.Kx,getPath:Ui.ve,getPolyline:Ui.yp}); ');