2 lines
8.0 KiB
JavaScript
2 lines
8.0 KiB
JavaScript
/**/_jsload2&&_jsload2('buslinesearch', 'x.extend(Ee.prototype,{Td:function(){for(var a=0,b=this.Oa.length;a<b;a++){var c=this.Oa[a];this[c.method].apply(this,c.arguments)}delete this.Oa},sv:function(a,b,c){a=T.tb(a);return B.Fp+"?c="+a.lng+","+a.lat+"&i="+b+","+encodeURIComponent(c)+"&s="+encodeURIComponent("tpl:LinesQuery")},getBusList:function(a){var b=this;this.Og(this.Ad,function(c){c?$d.fb(function(a,c){b.HQ(a,c)},{qt:b.VP,c:c,wd:a},{wb:a}):(this.uc=new Li({wb:a,city:"",xi:"",Kh:""}),b.sb(5),b.Ra(Y.Ju,this.uc))})},HQ:function(a,b){this.clearResults(); var c=a.result;if(!a.content||0!=c.error||c.type!=this.XP)this.uc=new Li({wb:b.wb,city:a.current_city.name,xi:"",Kh:a.current_city.code}),this.sb(7),this.Ra(Y.Ju,this.uc);else{for(var c=a.content,d=[],e=0,f=c.length;e<f;e++)d.push({name:c[e].name,nk:c[e].uid,Kh:a.current_city.code,Zj:e,$A:b.wb,Yi:c[e].poiType||2});this.uc=new Li({wb:b.wb,city:a.current_city.name,xi:this.sv(Q.eb(a.current_city.geo,o).point,a.current_city.code,b.wb),TM:d,Kh:a.current_city.code});this.sb(0);this.Ra(Y.Ju,this.uc);this.fU(); this.gT(a.current_city.geo,a.current_city.level,a.current_city.code)}},fU:function(){if(this.k.ja.Ha&&this.k.ja.Ha.appendChild&&this.uc&&0<this.uc.gt()){var a=H("div",{style:"font:12px "+I.fontFamily+";background:#fff"});a.id="divResult"+this.ba;for(var b=this.uc.gt(),c=[],d=0;d<b;d++){var e=this.uc.VD(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="+Ee.Bv+\' 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.Ha.appendChild(a);this.Ra(Y.AG,a)}},gT:function(a,b,c){var d=this.k.ja.map; d&&(a=Q.eb(a,o).point,this.wB?this.wB!=c&&(d.Gd(a,b),this.wB=c):(d.Gd(a,b),this.wB=c))},TU:function(a){if(this.uc)for(var b=0,c=this.uc.gt();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=Ee.ZS):(d.style.display="none",e.src=Ee.Bv):(d.style.display="none",e.src=Ee.Bv)}},_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=Ee.Bv;return}}if(this.uc&& this.uc[a]&&0<this.uc[a].ip())this.Fc=this.uc[a],this.sb(0),this.Ra(Y.Iu,this.Fc),this.dJ(a),this.cJ(a);else{var e=this,c=this.uc.VD(a);$d.fb(function(b,c){e.GQ(b,c,a)},{qt:e.UP,c:c.Kh,uid:c.nk},{name:c.name,Yi:c.Yi})}},clearResults:function(){delete this.uc;delete this.Fc;delete this.aj;delete this.D1;this.Rj();this.k.ja.Ha&&(this.k.ja.Ha.innerHTML="")},getBusLine:function(a){a&&("object"==typeof a&&a.nk&&""!=a.nk&&"undefined"!=typeof a.Kh&&""!=a.Kh.toString()&&"undefined"!=typeof a.Zj&&""!=a.Zj.toString()&& "undefined"!=typeof a.$A&&""!=a.$A.toString())&&(this.uc&&0<this.uc.gt()&&a.Kh==this.uc.Kh&&a.$A==this.uc.keyword)&&this._selectBusListItem(a.Zj,o)},GQ:function(a,b,c){var d=a.result;if(!a.content||!a.content[0]||0!=d.error||d.type!=this.WP)this.Fc=new Mi({name:b.name}),this.sb(7),this.Ra(Y.Iu,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.eb(a.geo,o),g=new zd(g.ha));if(a.stations)for(var k=0,l=a.stations.length;k<l;k++)if(a.stations[k].geo){var m= Q.eb(a.stations[k].geo,o);i.push({name:a.stations[k].name,position:m.point,nk:a.stations[k].uid})}this.Fc=new Mi({name:b.name,startTime:d,XW:e,ZV:f,EZ:g,GO:i,Yi:b.Yi});this.sb(0);this.Ra(Y.Iu,this.Fc);this.uc[c]=this.Fc;this.dJ(c);this.cJ(c)}},dJ:function(a){if(this.k.ja.Ha&&this.k.ja.Ha.appendChild&&this.Fc&&0<this.Fc.ip()){this.TU(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.ip();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.yx(d).name+"</a></td></tr>");c.push("</tbody></table>");b.innerHTML=c.join("")}a=x.Ec("divResult"+this.ba);this.Ra(Y.zG,a)}},cJ:function(a){if(this.k.ja.map&&this.Fc&&0<this.Fc.ip()){this.Rj();X.$l(this.k.ja.map,this.Fc.ve());var b=this.Fc.lp();this.Ra(Y.Ku,b);var c=this;this.aj=[];for(var d=0,e=this.Fc.ip();d<e;d++){var f=this.Fc.yx(d).position,g=this.Fc.yx(d).name,f=X.oV(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 md(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.xm?af.wp(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.SB=g;this.aj.push(f)}this.Ra(Y.lq,this.aj);this.k.ja.ah&&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.SB){var d=["<div style=\'font:12px "+I.fontFamily+"\'>"];d.push("<div style=\'margin:10px 1em 24px 0\'><b>"+c.SB+"</b></div>");d.push("</div>");var e=new md(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.xm?af.wp(e,d.getCurrentCity().code,{panoInstance:d.P,lngLat:c.ia(),titleTip:c.SB,type:"busline"},function(){c.Mb(e)}):c.Mb(e)}}else{this.RN&&(this.RN.style.backgroundColor="#ffffff");if(d=x.Ec("aStop_"+a+"_"+b))d.style.backgroundColor="#cccccc";this.RN=d}},Rj:function(){this.k.ja.map&&this.k.ja.map.CK()}, sb:function(a){"number"==typeof a?this.Dd=a:delete this.Dd}});function Li(a){this.keyword=a.wb||"";this.city=a.city;this.moreResultsUrl=a.xi;this.cB=a.TM&&a.TM.slice(0)||[];this.Kh=a.Kh}x.extend(Li.prototype,{VD:function(a){if(this.cB[a])return this.cB[a]},gt:function(){return this.cB.length}});var Ni=Li.prototype;U(Ni,{getNumBusList:Ni.gt,getBusListItem:Ni.VD});function Mi(a){this.name=a.name||"";this.startTime=a.startTime||"";this.endTime=a.XW||"";this.company=a.ZV||"";this.Zi=a.EZ||{};this.UB=a.GO&&a.GO.slice(0)||[];this.Yi=a.Yi||2}x.extend(Mi.prototype,{yx:function(a){if(this.UB[a])return this.UB[a]},ip:function(){return this.UB.length},lp:v("Zi"),ve:function(){if(this.Zi.ve())return this.Zi.ve()}});var Oi=Mi.prototype;U(Oi,{getNumBusStations:Oi.ip,getBusStation:Oi.yx,getPath:Oi.ve,getPolyline:Oi.lp}); ');
|