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!