【发布时间】:2016-02-18 20:23:05
【问题描述】:
我使用 Ionic 框架和 AngularJS 开发了一个演示应用
我遇到了位置问题,我没有得到准确的结果。 位置已更改。例如,我在路上行走,它会显示我在路外的位置。
我在同一设备/手机上使用 Google 地图应用程序获得了准确的位置结果,但使用此代码无法获得准确的结果。它偏离了大约 100m
这是我的代码..
navigator.geolocation.getCurrentPosition
(
GetCurrentLocation,
geo_error, geo_options,
{desiredAccuracy:1, maxWait:function geo_error() {
alert("Sorry, no position available.");
}
var geo_options =
{
enableHighAccuracy: true,
maximumAge : 1000,
timeout : 27000
};
function GetCurrentLocation(post){
console.log(pos);
}
我在 stack-overflow 和 google 上找到了很多解决方案,但问题没有解决。
【问题讨论】:
标签: javascript angularjs google-maps-api-3 geolocation google-maps-api-2