我有一个页面,我需要根据设备的当前位置获取用户的当前位置,我使用了“buildfire.geo.getCurrentPosition”,它正在进行本地主机开发,但在发布期间它没有在职的。
buildfire.geo.getCurrentPosition(null, (err, position) => {
if(err)
console.log(err);
else {
let currentLoc = this.state.currentLoc;
currentLoc['coordinates'] = {lat: position.coords.latitude, lng: position.coords.longitude};
this.setState({currentLoc});
}
});