1

I have this html page:

<!DOCTYPE html>
<html>
<head>
    <title>Geolocation test</title>
</head>
<body>
    <script type="text/javascript">
        navigator.geolocation.getCurrentPosition(function (position) {
            alert(position.coords.latitude + ',' + position.coords.longitude);
        }, function (error) {
            alert(error.code);
        }, {enableHighAccuracy: true, maximumAge: 0});
    </script>
</body>

Works on:

  • Samsung Galaxy 3 Google Chrome
  • Samsung Galaxy 3 native web browser
  • Chrome Desktop.

Doesnt works on:

  • Samsung Galaxy S2 Chrome
  • Samsung Galaxy S2 native
  • Firefox in desktop

I´ve been reading a lot of questions about this issue, but all of them says sometimes the position is unavailable or may be take a long time to retrieve it, but when I open the android maps app, it shows a perfect location immediately (even if I dont use it for a while)

I know I can use the timeout option to handle the error callback, but thats not a solution for me.

Thanks!

joserobleda
  • 788
  • 1
  • 8
  • 12
  • seems to be related to [Cordova 3.1 and Phone Gap Geolocation fails with “Position retrieval timed out” on Android][1] [1]: http://stackoverflow.com/questions/19567798/cordova-3-1-and-phone-gap-geolocation-fails-with-position-retrieval-timed-out – qefzec Oct 31 '13 at 14:19
  • Refer to Question: https://stackoverflow.com/questions/13386996/navigator-geolocation-getcurrentposition-not-updating-in-chrome-mobile/54470936#54470936 – Kelly Orr Jan 31 '19 at 23:51

1 Answers1

0

It may be due to problems of application permissions

https://support.google.com/chrome/answer/142065?hl=en

user237474
  • 21
  • 2