"BMap"in window||alert("LBS 需要依赖 BaiduMap");var LBS=function(){var e=this;this.processWithCache=function(t,o,i){i=i||0;var s=window.localStorage.getItem("lbsCacheTime"),a=window.localStorage.getItem("lbsPoint"),n=window.localStorage.getItem("lbsAddress");s&&a&&n&&s+1e3*i>(new Date).getTime()?t(JSON.parse(a),JSON.parse(n)):e.process(function(e,o){window.localStorage.setItem("lbsCacheTime",(new Date).getTime()),window.localStorage.setItem("lbsPoint",JSON.stringify(e)),window.localStorage.setItem("lbsAddress",JSON.stringify(o)),t(e,o)},o)},this.process=function(e,t){(new BMap.Geolocation).getCurrentPosition(function(o){if(this.getStatus()==BMAP_STATUS_SUCCESS){var i=o.point;(new BMap.Geocoder).getLocation(i,function(t){var o=t.addressComponents,s={lng:i.lng,lat:i.lat},a={city:o.city,district:o.district,street:o.street,streetNumber:o.streetNumber};e&&e(s,a)})}else t&&t("定位失败")},{enableHighAccuracy:!0})}};module.exports=LBS;