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
8.0 KiB

/**/_jsload2&&_jsload2('buslinesearch', 'z.extend(we.prototype,{Qd:function(){for(var a=0,b=this.Ra.length;a<b;a++){var c=this.Ra[a];this[c.method].apply(this,c.arguments)}delete this.Ra},Cu:function(a,b,c){a=S.Gb(a);return D.Uo+"?c="+a.lng+","+a.lat+"&i="+b+","+encodeURIComponent(c)+"&s="+encodeURIComponent("tpl:LinesQuery")},getBusList:function(a){var b=this;this.Eg(this.yd,function(c){c?Md.nb(function(a,c){b.mP(a,c)},{qt:b.HO,c:c,wd:a},{wb:a}):(this.vc=new qi({wb:a,city:"",gi:"",vh:""}),b.Xa(5),b.Ja(X.Vt,this.vc))})},mP:function(a,b){this.clearResults(); var c=a.result;if(!a.content||0!=c.error||c.type!=this.JO)this.vc=new qi({wb:b.wb,city:a.current_city.name,gi:"",vh:a.current_city.code}),this.Xa(7),this.Ja(X.Vt,this.vc);else{for(var c=a.content,e=[],f=0,g=c.length;f<g;f++)e.push({name:c[f].name,Vj:c[f].uid,vh:a.current_city.code,Gj:f,Vz:b.wb,Ii:c[f].poiType||2});this.vc=new qi({wb:b.wb,city:a.current_city.name,gi:this.Cu(db.ze(a.current_city.geo,p).point,a.current_city.code,b.wb),HL:e,vh:a.current_city.code});this.Xa(0);this.Ja(X.Vt,this.vc);this.JS(); this.IR(a.current_city.geo,a.current_city.level,a.current_city.code)}},JS:function(){if(this.m.pa.Oa&&this.m.pa.Oa.appendChild&&this.vc&&0<this.vc.ks()){var a=O("div",{style:"font:12px "+H.fontFamily+";background:#fff"});a.id="divResult"+this.ea;for(var b=this.vc.ks(),c=[],e=0;e<b;e++){var f=this.vc.LC(e).name;c.push(\'<dl style="margin:3px 3px"><dt><span style="cursor:pointer" onclick=Instance(\\\'\'+this.ea+"\')._selectBusListItem("+e+")><img id=imgBLIcon"+e+" src="+we.Mu+\' style="border:none" /></span>&nbsp;&nbsp;<a style="color:blue" href="javascript:void(0)" onclick=Instance(\\\'\'+ this.ea+"\')._selectBusListItem("+e+")>"+f+"</a></dt><dd id=ddBLInfo"+e+\' style="display:none;margin:2px 0px"></dd></dl>\')}b="";this.vc.moreResultsUrl&&(b=b+"<div style=\'color:#7777cc;background:#e5ecf9;overflow:hidden;padding:2px;text-align:right\'>"+("<a style=\'color:#7777cc\' href=\'"+this.vc.moreResultsUrl+"\' target=\'_blank\'>\\u5230\\u767e\\u5ea6\\u5730\\u56fe\\u67e5\\u770b&#187;</a>"),b+="&nbsp;</div>");a.innerHTML=c.join("")+b;this.m.pa.Oa.appendChild(a);this.Ja(X.sF,a)}},IR:function(a,b,c){var e=this.m.pa.map; e&&(a=db.ze(a,p).point,this.tA?this.tA!=c&&(e.Ed(a,b),this.tA=c):(e.Ed(a,b),this.tA=c))},uT:function(a){if(this.vc)for(var b=0,c=this.vc.ks();b<c;b++){var e=z.Ec("ddBLInfo"+b),f=z.Ec("imgBLIcon"+b);b==a?"none"==e.style.display?(e.style.display="block",f.src=we.AR):(e.style.display="none",f.src=we.Mu):(e.style.display="none",f.src=we.Mu)}},_selectBusListItem:function(a,b){if(!b){var c=z.Ec("ddBLInfo"+a),e=z.Ec("imgBLIcon"+a);if("block"==c.style.display){c.style.display="none";e.src=we.Mu;return}}if(this.vc&& this.vc[a]&&0<this.vc[a].Eo())this.Fc=this.vc[a],this.Xa(0),this.Ja(X.Ut,this.Fc),this.NH(a),this.MH(a);else{var f=this,c=this.vc.LC(a);Md.nb(function(b,c){f.lP(b,c,a)},{qt:f.GO,c:c.vh,uid:c.Vj},{name:c.name,Ii:c.Ii})}},clearResults:function(){delete this.vc;delete this.Fc;delete this.Li;delete this.Z0;this.xj();this.m.pa.Oa&&(this.m.pa.Oa.innerHTML="")},getBusLine:function(a){a&&("object"==typeof a&&a.Vj&&""!=a.Vj&&"undefined"!=typeof a.vh&&""!=a.vh.toString()&&"undefined"!=typeof a.Gj&&""!=a.Gj.toString()&& "undefined"!=typeof a.Vz&&""!=a.Vz.toString())&&(this.vc&&0<this.vc.ks()&&a.vh==this.vc.vh&&a.Vz==this.vc.keyword)&&this._selectBusListItem(a.Gj,p)},lP:function(a,b,c){var e=a.result;if(!a.content||!a.content[0]||0!=e.error||e.type!=this.IO)this.Fc=new ri({name:b.name}),this.Xa(7),this.Ja(X.Ut,this.Fc);else{var a=a.content[0],f=e="",g="",i={},k=[],e=a.startTime,f=a.endTime,g=a.company;a.geo&&(i=db.ze(a.geo,p),i=new Gc(i.na));if(a.stations)for(var m=0,n=a.stations.length;m<n;m++)if(a.stations[m].geo){var o= db.ze(a.stations[m].geo,p);k.push({name:a.stations[m].name,position:o.point,Vj:a.stations[m].uid})}this.Fc=new ri({name:b.name,startTime:e,QV:f,IU:g,TY:i,sN:k,Ii:b.Ii});this.Xa(0);this.Ja(X.Ut,this.Fc);this.vc[c]=this.Fc;this.NH(c);this.MH(c)}},NH:function(a){if(this.m.pa.Oa&&this.m.pa.Oa.appendChild&&this.Fc&&0<this.Fc.Eo()){this.uT(a);var b=z.Ec("ddBLInfo"+a);if(b){var c=[];c.push(\'<table style="width:100%;background:#CDCDCD;font:12px \'+H.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.Ii?c.push(\'<p style="margin:2px 0px;font:12px \'+H.fontFamily+\';">\\u6cbf\\u7ebf\\u5730\\u94c1\\u7ad9:</p>\'):c.push(\'<p style="margin:2px 0px;font:12px \'+H.fontFamily+\';">\\u6cbf\\u7ebf\\u516c\\u4ea4\\u7ad9\\u70b9:</p>\');c.push(\'<table style="width:100%;font:12px \'+H.fontFamily+\';" ><tbody>\');for(var e=0,f=this.Fc.Eo();e<f;e++)c.push(\'<tr><td style="width:20px">\'+(e+1)+"</th><td><a id=aStop_"+a+"_"+e+\' style="color:blue" href="javascript:void(0)" onclick=Instance(\\\'\'+ this.ea+"\')._selectBusStop("+a+","+e+")>"+this.Fc.Bw(e).name+"</a></td></tr>");c.push("</tbody></table>");b.innerHTML=c.join("")}a=z.Ec("divResult"+this.ea);this.Ja(X.rF,a)}},MH:function(a){if(this.m.pa.map&&this.Fc&&0<this.Fc.Eo()){this.xj();W.$n(this.m.pa.map,this.Fc.Re());var b=this.Fc.Ho();this.Ja(X.Wt,b);var c=this;this.Li=[];for(var e=0,f=this.Fc.Eo();e<f;e++){var g=this.Fc.Bw(e).position,i=this.Fc.Bw(e).name,g=W.RT(this.m.pa.map,g,i);(function(b,e,f){b.addEventListener("click",function(g){var i= ["<div style=\'font:12px "+H.fontFamily+"\'>"];i.push("<div style=\'margin:10px 1em 24px 0\'><b>"+e+"</b></div>");i.push("</div>");var v=new tc(i.join(""),{title:"",height:0,width:220,margin:[10,10,20,10]});v.addEventListener("open",function(){var b=z.Ec("aStop_"+a+"_"+f);b&&(b.style.backgroundColor="#cccccc")});v.addEventListener("close",function(){var b=z.Ec("aStop_"+a+"_"+f);b&&(b.style.backgroundColor="#ffffff")});i=c.m.pa.map;i.U.tC?Oe.fL(v,i.getCurrentCity().code,{panoInstance:i.W,lngLat:g.target.ja(), titleTip:e,type:"busline"},function(){b.ad(v)}):b.ad(v)})})(g,i,e);g.PA=i;this.Li.push(g)}this.Ja(X.Ap,this.Li);this.m.pa.Sg&&this.m.pa.map.mh(b.Re(),{margins:[5,5,5,5]})}},_selectBusStop:function(a,b){if(this.m.pa.map&&this.Li&&0<this.Li.length){var c=this.Li[b];if(c.PA){var e=["<div style=\'font:12px "+H.fontFamily+"\'>"];e.push("<div style=\'margin:10px 1em 24px 0\'><b>"+c.PA+"</b></div>");e.push("</div>");var f=new tc(e.join(""),{title:"",height:0,width:220,margin:[10,10,20,10]});f.addEventListener("open", function(){var c=z.Ec("aStop_"+a+"_"+b);c&&(c.style.backgroundColor="#cccccc")});f.addEventListener("close",function(){var c=z.Ec("aStop_"+a+"_"+b);c&&(c.style.backgroundColor="#ffffff")});e=this.m.pa.map;e.U.tC?Oe.fL(f,e.getCurrentCity().code,{panoInstance:e.W,lngLat:c.ja(),titleTip:c.PA,type:"busline"},function(){c.ad(f)}):c.ad(f)}}else{this.BM&&(this.BM.style.backgroundColor="#ffffff");if(e=z.Ec("aStop_"+a+"_"+b))e.style.backgroundColor="#cccccc";this.BM=e}},xj:function(){this.m.pa.map&&this.m.pa.map.lJ()}, Xa:function(a){"number"==typeof a?this.Ke=a:delete this.Ke}});function qi(a){this.keyword=a.wb||"";this.city=a.city;this.moreResultsUrl=a.gi;this.Zz=a.HL&&a.HL.slice(0)||[];this.vh=a.vh}z.extend(qi.prototype,{LC:function(a){if(this.Zz[a])return this.Zz[a]},ks:function(){return this.Zz.length}});var si=qi.prototype;U(si,{getNumBusList:si.ks,getBusListItem:si.LC});function ri(a){this.name=a.name||"";this.startTime=a.startTime||"";this.endTime=a.QV||"";this.company=a.IU||"";this.Oj=a.TY||{};this.RA=a.sN&&a.sN.slice(0)||[];this.Ii=a.Ii||2}z.extend(ri.prototype,{Bw:function(a){if(this.RA[a])return this.RA[a]},Eo:function(){return this.RA.length},Ho:x("Oj"),Re:function(){if(this.Oj.Re())return this.Oj.Re()}});var ti=ri.prototype;U(ti,{getNumBusStations:ti.Eo,getBusStation:ti.Bw,getPath:ti.Re,getPolyline:ti.Ho}); ');