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

/**/_jsload2 && _jsload2('pservice', 'var Bj=5;bd.ev=B.Sf("pano")[0];bd.pl=bd.ev+"?";bd.LG=B.Sf("baidumap");bd.kQ=B.Sf("main_domain_nocdn");bd.Xd=new T;bd.FB=[]; x.extend(bd.prototype,{lR:function(){var a=this,b;for(b in this.yd)if(0!==this.yd[b].length)switch(b){case "getPanoramaById":x.Fb(this.yd[b],function(b){a.xp.apply(a,b)});break;case "getPanoramaByLocation":x.Fb(this.yd[b],function(b){a.tj.apply(a,b)});break;case "getVisiblePOIs":x.Fb(this.yd[b],function(b){a.FE.apply(a,b)});break;case "getRecommendPanosById":x.Fb(this.yd[b],function(b){a.ay.apply(a,b)});break;case "getPanoramaVersions":x.Fb(this.yd[b],function(b){a.$x.apply(a,b)});break;case "checkPanoSupportByCityCode":x.Fb(this.yd[b], function(b){a.IC.apply(a,b)});break;case "getPanoramaByPOIId":x.Fb(this.yd[b],function(b){a.Zx.apply(a,b)});break;case "getCopyrightProviders":x.Fb(this.yd[b],function(b){a.z3.apply(a,b)})}},xp:function(a,b,c){this.hI(bd.pl+"qt=sdata&l=17&sid="+a+"&fn=",b,c)},tj:function(a,b,c){"function"==typeof b&&(c=b,b=50);a=bd.Xd.Fl(a);this.hI(bd.pl+"qt=qsdata&x="+a.x+"&y="+a.y+"&r="+b+"&action=1&fn=",c)},FE:function(a,b,c,d){a=bd.Xd.Fl(a);this.mg(bd.pl+"qt=search&x="+a.x+"&y="+a.y+"&radius="+b+"&tag="+c+"&fn=", function(a){for(var a=a.content,b=[],c=p,i=a.length-1;0<=i;i--)c=a[i],b.push({iconType:c.Type,title:c.name,altitude:c.Height,panoInfo:{panoId:c.PID,panoIId:c.IID,heading:c.Dir,pitch:c.Pitch},position:bd.Xd.Ej(new R(c.X,c.Y))});d(b)},o)},ay:function(a,b){this.mg(bd.pl+"qt=guide&sid="+a+"&fn=",function(a){if(a.content){for(var a=a.content,d=[],e=p,f=0,g=a.length;f<g;f++)e=a[f],d.push({panoId:e.PID,heading:e.Dir,name:e.Info,recoType:e.Type,pitch:e.Pitch,catlog:e.Catalog,floor:e.Floor});b(d)}},o)},WL:function(a){this.mg(bd.LG+ "?qt=panoCMS&file=pano_copyright&callback=",function(b){a(b)})},$x:function(a){this.mg(bd.LG+"?qt=pver&callback=",function(b){b?a&&a(b):a&&a(p)})},IC:function(a,b){function c(a){for(var b=bd.FB,c=0,g=b.length;c<g;c++)if(b[c]==a)return o;return q}0===bd.FB.length?this.mg(bd.kQ+"?qt=panoCityList&t="+(new Date).getTime()+"&callback=",function(d){d?(bd.FB=d,b(c(a))):b(q)}):b(c(a))},Zx:function(a,b){var c=this;this.$x(function(d){d&&d.panoUdt&&c.mg(bd.pl+"qt=poi&udt="+d.panoUdt.version+"&uid="+a+"&fn=", function(a){if(a&&a.content&&a.content[0]&&a.content[0].poiinfo){var a=a.content[0].poiinfo,d={id:a.IID||a.PID,pid:a.PID,type:1==a.hasinter?"inter":"street",description:a.name,links:p,position:bd.Xd.Ej(new R(a.X,a.Y)),tiles:p,pov:1==a.hasinter?p:{heading:a.Dir,pitch:a.Pitch}};"inter"===d.type?c.VS(a.IID,function(a){if(a){for(var c=a.Defaultfloor,e=p,l=0,m=a.Floors.length;l<m;l++)if(a.Floors[l].Floor===c){e=a.Floors[l];break}e&&(d.interID=e.StartID)}b(d)}):b(d)}else b(p)},o)})},Y1:function(a,b,c){var d= this;this.mg(a,function(a){a&&a.result&&0==a.result.error?b&&b(d.SI(a,c)):b&&b(p)})},hI:function(a,b,c){var d=this;this.mg(a,function(a){a&&a.result&&0==a.result.error?b&&b(d.SI(a,c)):b&&b(p)},o,o)},mg:function(a,b,c,d){var e=(1E5*Math.random()).toFixed(0);B._rd=B._rd||{};B._rd["_cbk"+e]=function(a){b&&b(a);delete B._rd["_cbk"+e]};a+="BMap._rd._cbk"+e;if(c&&(c=Fc(a)))d=Qc(c.path,{Kp:!d?q:o}),a+="&"+d;sa(a)},SI:function(a,b){var c={},d=a.content[0];c.description=d.Rname||d.Info||"";c.id=d.ID;c.wh= d.X/100;c.xh=d.Y/100;c.position=bd.Xd.Ej(new R(c.wh,c.xh));var e=this.KT(d,c.id,c.wh,c.xh,d.NorthDir);c.links=e[0];c.roads=e[1];c.links.sort(function(a,b){return a.zh-b.zh});c.mode=d.Mode;c.relevants=[];if(d.SwitchID)for(e=0;e<d.SwitchID.length;e++)c.relevants[e]={id:d.SwitchID[e].ID,mode:d.SwitchID[e].Time.toLowerCase()};c.tiles=new Cj({dirNorth:d.NorthDir,centerHeading:(180+d.NorthDir)%360,pitch:d.Pitch});if(d.Enters&&0<d.Enters.length){c.indoorPois=[];for(var e=0,f=d.Enters.length;e<f;e++)c.indoorPois.push({panoIId:d.Enters[e].IID, panoId:d.Enters[e].BreakID,title:d.Enters[e].Name,pointX:d.Enters[e].X/100,pointY:d.Enters[e].Y/100})}var f=[],g=d.VPoint;if(g)for(var i=g.length,e=0;e<i;e++){var j={};j.PID=g[e].PID;var l=bd.Xd.Ej(new R(g[e].X/100,g[e].Y/100));j.X=6378137*-(l.lat-c.position.lat)/180*Math.PI;j.Z=6378137*(l.lng-c.pos