[postlink]
https://the-best-way-of-life-is-islam.blogspot.com/2015/07/accuracy-discrepancy-between-google.html
[/postlink]
I found a lot of treatment of geolocation accuracy, but nothing that addresses the difference between the Google API and Maps. This is on Android Chrome.
Indeed, there's a large discrepancy between the two. The API gives me 30 meters at best, but Maps manages less than 10. What gives? Here are snippets from my code:
<script type="text/javascript"
src="http://ift.tt/1btSrES">
</script>
Then later:
function getLoc() {
navigator.geolocation.getCurrentPosition(showLoc, errorLoc,
{maximumAge:15000, timeout:60000, enableHighAccuracy:true});
}
function showLoc(position) {
var elt = document.getElementById("userloc");
elt.innerHTML = "Lat " + position.coords.latitude + " " +
"Long " + position.coords.longitude + " " +
"Accuracy " + position.coords.accuracy;
}
function errorLoc(msg) {
alert(msg);
}
Enregistrer un commentaire