H
H
HappyCougar2015-01-18 15:13:29
JavaScript
HappyCougar, 2015-01-18 15:13:29

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

1 answer(s)
E
Egor Kazantsev, 2015-01-19
@saintbyte

Why doesn't she want to work?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question