我一直在使用HTML5地理定位选项,并注意到结果可能有点不稳定,并且想知道是否有办法让它们更加一致。
我一直在iphone 5上进行所有测试,只使用带有enableHighAccuracy的标准getCurrentPosition代码:true和enableHighAccuracy:false,但有时当我点击代码来获取我在谷歌地图上的位置时有时约0.25-0.5英里 - 但是(这是一个很大的问题)如果我去手机上的地图应用程序它会移动一下然后让我的位置开始响起。
我能做些什么来达到同样的准确度吗?
说到准确性 - position.coords.accuracy命令实际上是做什么或意味着什么?我已经有一张地图位置撞到了我现在所说的1200之类的东西我已经把它显示在离我位置400码远的地方我得到165
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition,showError,{maximumAge:600000, timeout:5000, enableHighAccuracy: true});
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
function showPosition(position) {
var x = document.getElementById("demo");
var marker = new google.maps.Marker({position: {lat:position.coords.latitude, lng:position.coords.longitude}, map: map, title: 'X'});
x.innerHTML = "Latitude: " + position.coords.latitude + "
Longitude: " + position.coords.longitude + "
Accuracy: " + position.coords.accuracy;
}
道歉我很想在这个论坛发帖。