Answer the question
In order to leave comments, you need to log in
How to fix geolocation bug in android?
rlexpert.ru/map.php
The page determines your location and plots a route on the Yandex map. Everything seems to be normal, it works fine on most browsers (including Safari on iOS), but geolocation does not want to work on android.
I request geolocation data in this way:
if (navigator.geolocation) {
var location_timeout = setTimeout("geolocFail()", 15000);
navigator.geolocation.getCurrentPosition(function(position) {
clearTimeout(location_timeout);
lat = position.coords.latitude;
lng = position.coords.longitude;
}, function(error) {
clearTimeout(location_timeout);
geolocFail();
},
{
maximumAge:Infinity,
timeout:Infinity,
enableHighAccuracy:false
});
} else {
geolocFail();
}
function geolocFail(){
alert("Ваш браузер не поддерживает гео-локацию, или она была отключена");
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question