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
1 line
8.0 KiB
10 months ago
|
/**/_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> <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»</a>"),b+=" </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("ddBLIn
|