1 line
14 KiB
JavaScript
1 line
14 KiB
JavaScript
|
|
_jsload2&&_jsload2('othersearch', 'z.extend(Ud.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},vm:function(a,b,c){c=c||"\\u5317\\u4eac\\u5e02";/^[ \\s]*$/.test(a)||rd.ab(function(a){if(a&&a.result&&35==a.result.type){var c=a.result,a=a.content,g=s,i=s;if(c&&0==c.error&&a)var c=a.cn,i=a.sc,k=a.wd,m=a.prc,n=a.fuzzy_score,o=a.catalog,g=new J(a.coord.x,a.coord.y),g=S.Tb(g),i={city:c,citycode:i,address:k,precise:m,confidence:n,level:o};b&&b(g,i)}},{qt:"gc", wd:a,cn:c})},rm:function(a,b,c){if(!(a instanceof J)&&b)b(s);else{var a=S.Eb(a),e=a.lng,a=a.lat,c=c||{};rd.ab(function(a){var c=s;if(a&&a.result&&44==a.result.type){var e=a.content,k={},m=[];if(0==a.result.error&&e){c=e.address_detail;a=c.city;c&&(k.streetNumber=c.street_number,k.street=c.street,k.district=c.district,k.city=a,k.province=c.province);var c=e.point,c=new J(c.x,c.y),c=S.Tb(c),n=e.surround_poi;if(n&&n.length)for(var o=0,p=n.length;o<p;o++){var v={},x=n[o];v.title=x.name;v.uid=x.uid;var y= new J(x.point.x,x.point.y),y=S.Tb(y);v.point=y;v.city=a;v.Pi=x.poiType;v.type=0;v.address=x.addr;v.postcode=x.zip||s;v.phoneNumber=x.tel||s;x=v.Pi;0!==x.length&&(v.pu=x.split(","));m.push(v)}c={point:c,address:e.address,addressComponents:k,surroundingPois:m,business:e.business}}}b&&b(c)},{qt:"rgc",x:e,y:a,dis_poi:c.poiRadius||100,poi_num:c.numPois||10,latest_admin:"1"})}}});T(Vd,{getPoint:Vd.vm,getLocation:Vd.rm});function Ph(a){var b=document.createElement("script");b.onload=function(){b.parentNode.removeChild(b)};b.src=a;document.getElementsByTagName("head")[0].appendChild(b)} z.extend(Geolocation.prototype,{getCurrentPosition:function(a,b){function c(b){k||(m&&(clearTimeout(m),m=s),i.xL=b,a.apply(i,arguments),k=q)}function e(b){if(!k&&(m&&(clearTimeout(m),m=s),i.xL=b,B!==s))a.apply(i,arguments),k=q,Ra(8E3,{longitude:b.longitude,latitude:b.latitude,accuracy:b.accuracy})}function f(a){navigator.geolocation&&(new Qh({timeout:i.K.timeout,maximumAge:i.K.maximumAge,enableHighAccuracy:i.K.enableHighAccuracy})).getCurrentPosition(function(a){e(a)},function(b){switch(b.errorCode){case b.kz:i.Vp= td;c(s);break;case b.Iu:i.Vp=sd;a();break;case b.CG:i.Vp=ud,a()}})}function g(a){(new Rh).getCurrentPosition(function(a){e(a)},function(){a()})}var i=this,k=t,b=b||{};i.K={timeout:b.timeout||i.K.timeout,maximumAge:b.maximumAge||i.K.maximumAge,enableHighAccuracy:b.enableHighAccuracy||i.K.enableHighAccuracy,zi:b.SDKLocation||i.K.zi};var m=setTimeout(function(){k||(i.Vp=ud,c(s))},i.K.timeout);(function(a){(new Sh({zi:i.K.zi})).getCurrentPosition(function(a){e(a)},function(){a()})})(function(){f(function(){g(function(){i.Vp= sd;c(s)})})})},xm:function(){this.xL&&(this.Vp=0);return this.Vp}});Geolocation.prototype.getCurrentPosition=Geolocation.prototype.getCurrentPosition;Geolocation.prototype.getStatus=Geolocation.prototype.xm;function Qh(a){this.K={timeout:a.timeout||5E3,maximumAge:a.maximumAge||6E5,enableHighAccuracy:a.enableHighAccuracy||t}} z.extend(Qh.prototype,{getCurrentPosition:function(a,b){function c(a){var c=new Th;a.code===a.PERMISSION_DENIED&&-1===a.message.indexOf("secure")&&(c.errorCode=c.kz,c.uk="\\u7528\\u6237\\u51b3\\u7edd\\u5b9a\\u4f4d\\u8bf7\\u6c42");a.code===a.POSITION_UNAVAILABLE&&(c.errorCode=c.Iu,c.uk="\\u5b9a\\u4f4d\\u4e0d\\u53ef\\u7528");-1<a.message.indexOf("secure")&&(confirm(location.hostname+"\\u60f3\\u8981\\u83b7\\u53d6\\u60a8\\u5f53\\u524d\\u7684\\u4f4d\\u7f6e\\u3002\\u5141\\u8bb8\\u8bf7\\u70b9\\u51fb\\u786e\\u5b9a\\uff0c\\u7981\\u6b62\\u8bf7\\u70b9\\u51fb\\u53d6\\u6d88")? (c.errorCode=c.Iu,c.uk="\\u5b9a\\u4f4d\\u4e0d\\u53ef\\u7528"):(c.errorCode=c.kz,c.uk="\\u7528\\u6237\\u51b3\\u7edd\\u5b9a\\u4f4d\\u8bf7\\u6c42"));a.code===a.TIMEOUT&&(c.errorCode=c.CG,c.uk="\\u5b9a\\u4f4d\\u8d85\\u65f6");b(c)}function e(b){if(/BIDUBrowser/i.test(navigator.userAgent))(new Ud).rm(new J(b.coords.longitude,b.coords.latitude),function(c){var e=new Uh;e.accuracy=1999<b.coords.accuracy?1999:b.coords.accuracy;e.longitude=b.coords.longitude;e.latitude=b.coords.latitude;e.point=new J(e.longitude,e.lat
|