1 line
8.0 KiB
JavaScript
1 line
8.0 KiB
JavaScript
|
|
_jsload2&&_jsload2('buslinesearch', 'z.extend(Yd.prototype,{Sd: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},pv:function(a,b,c){a=S.Eb(a);return B.vp+"?c="+a.lng+","+a.lat+"&i="+b+","+encodeURIComponent(c)+"&s="+encodeURIComponent("tpl:LinesQuery")},getBusList:function(a){var b=this;this.Mg(this.Ad,function(c){c?rd.ab(function(a,c){b.GQ(a,c)},{qt:b.TP,c:c,wd:a},{vb:a}):(this.xc=new ai({vb:a,city:"",ni:"",Dh:""}),b.Ta(5),b.Fa(W.Fu,this.xc))})},GQ:function(a,b){this.clearResults(); var c=a.result;if(!a.content||0!=c.error||c.type!=this.VP)this.xc=new ai({vb:b.vb,city:a.current_city.name,ni:"",Dh:a.current_city.code}),this.Ta(7),this.Fa(W.Fu,this.xc);else{for(var c=a.content,e=[],f=0,g=c.length;f<g;f++)e.push({name:c[f].name,hk:c[f].uid,Dh:a.current_city.code,Rj:f,TA:b.vb,Pi:c[f].poiType||2});this.xc=new ai({vb:b.vb,city:a.current_city.name,ni:this.pv(ab.Be(a.current_city.geo,q).point,a.current_city.code,b.vb),WM:e,Dh:a.current_city.code});this.Ta(0);this.Fa(W.Fu,this.xc);this.hU(); this.gT(a.current_city.geo,a.current_city.level,a.current_city.code)}},hU:function(){if(this.j.la.Ma&&this.j.la.Ma.appendChild&&this.xc&&0<this.xc.$s()){var a=L("div",{style:"font:12px "+G.fontFamily+";background:#fff"});a.id="divResult"+this.aa;for(var b=this.xc.$s(),c=[],e=0;e<b;e++){var f=this.xc.MD(e).name;c.push(\'<dl style="margin:3px 3px"><dt><span style="cursor:pointer" onclick=Instance(\\\'\'+this.aa+"\')._selectBusListItem("+e+")><img id=imgBLIcon"+e+" src="+Yd.zv+\' style="border:none" /></span> <a style="color:blue" href="javascript:void(0)" onclick=Instance(\\\'\'+ this.aa+"\')._selectBusListItem("+e+")>"+f+"</a></dt><dd id=ddBLInfo"+e+\' style="display:none;margin:2px 0px"></dd></dl>\')}b="";this.xc.moreResultsUrl&&(b=b+"<div style=\'color:#7777cc;background:#e5ecf9;overflow:hidden;padding:2px;text-align:right\'>"+("<a style=\'color:#7777cc\' href=\'"+this.xc.moreResultsUrl+"\' target=\'_blank\'>\\u5230\\u767e\\u5ea6\\u5730\\u56fe\\u67e5\\u770b»</a>"),b+=" </div>");a.innerHTML=c.join("")+b;this.j.la.Ma.appendChild(a);this.Fa(W.vG,a)}},gT:function(a,b,c){var e=this.j.la.map; e&&(a=ab.Be(a,q).point,this.pB?this.pB!=c&&(e.Fd(a,b),this.pB=c):(e.Fd(a,b),this.pB=c))},UU:function(a){if(this.xc)for(var b=0,c=this.xc.$s();b<c;b++){var e=z.Fc("ddBLInfo"+b),f=z.Fc("imgBLIcon"+b);b==a?"none"==e.style.display?(e.style.display="block",f.src=Yd.YS):(e.style.display="none",f.src=Yd.zv):(e.style.display="none",f.src=Yd.zv)}},_selectBusListItem:function(a,b){if(!b){var c=z.Fc("ddBLInfo"+a),e=z.Fc("imgBLIcon"+a);if("block"==c.style.display){c.style.display="none";e.src=Yd.zv;return}}if(this.xc&& this.xc[a]&&0<this.xc[a].cp())this.Gc=this.xc[a],this.Ta(0),this.Fa(W.Eu,this.Gc),this.ZI(a),this.YI(a);else{var f=this,c=this.xc.MD(a);rd.ab(function(b,c){f.FQ(b,c,a)},{qt:f.SP,c:c.Dh,uid:c.hk},{name:c.name,Pi:c.Pi})}},clearResults:function(){delete this.xc;delete this.Gc;delete this.Si;delete this.T1;this.Hj();this.j.la.Ma&&(this.j.la.Ma.innerHTML="")},getBusLine:function(a){a&&("object"==typeof a&&a.hk&&""!=a.hk&&"undefined"!=typeof a.Dh&&""!=a.Dh.toString()&&"undefined"!=typeof a.Rj&&""!=a.Rj.toString()&& "undefined"!=typeof a.TA&&""!=a.TA.toString())&&(this.xc&&0<this.xc.$s()&&a.Dh==this.xc.Dh&&a.TA==this.xc.keyword)&&this._selectBusListItem(a.Rj,q)},FQ:function(a,b,c){var e=a.result;if(!a.content||!a.content[0]||0!=e.error||e.type!=this.UP)this.Gc=new bi({name:b.name}),this.Ta(7),this.Fa(W.Eu,this.Gc);else{var a=a.content[0],f=e="",g="",i={},k=[],e=a.startTime,f=a.endTime,g=a.company;a.geo&&(i=ab.Be(a.geo,q),i=new Gc(i.ja));if(a.stations)for(var m=0,n=a.stations.length;m<n;m++)if(a.stations[m].geo){var o= ab.Be(a.stations[m].geo,q);k.push({name:a.stations[m].name,position:o.point,hk:a.stations[m].uid})}this.Gc=new bi({name:b.name,startTime:e,fX:f,gW:g,OZ:i,HO:k,Pi:b.Pi});this.Ta(0);this.Fa(W.Eu,this.Gc);this.xc[c]=this.Gc;this.ZI(c);this.YI(c)}},ZI:function(a){if(this.j.la.Ma&&this.j.la.Ma.appendChild&&this.Gc&&0<this.Gc.cp()){this.UU(a);var b=z.Fc("ddBLInfo
|