This works on Safari
on Mac OS X
, and Chrome
on both Mac OS X
and Android
.
But it fails on Safari
on iOS
(tested on both iPhone 8
and iPad
).
if (navigator.geolocation) {
alert('geolocation OK');
navigator.geolocation.getCurrentPosition(function(position) {
alert('getCurrentPosition OK');
BaseLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
initMap();
});
}
I am getting the alert geolocation OK
, but the second getCurrentPosition OK
doesn't show on iOS
and initMap
is never called.
How do I debug, I do not have a USB cable to connect my iPhone
or iPad
.