How can I get GPS location in Android Webkit or Opera Mobile 10

Well, the question is in the title.

How to get GPS location on a mobile device in Android Webkit and / or Opera Mobile 10?

So, on iPhone Safari, this is doable. What about these two browsers? I searched for such functions and found nothing. Can this be done with javascript?

+3
source share
1 answer

see http://html5demos.com/geo . Corresponding JS bit for HTML5 location:

if (navigator.geolocation) {
  navigator.geolocation.getCurrentPosition(successCallback, errorCallback);
} else {
  error('not supported');
}

yep, it's easy.

+3
source

Source: https://habr.com/ru/post/1779505/


All Articles