A simple code getting current user geolocation is strangely ... ignored: it doesn't go to the success callback, neither in the error callBack, so I really have no idea of the cause. As window.geolocation is provided in LockerService secureWindow, I assume it's supposed to work ... but how ?
Many thanks & best regards
Sample code to reproduce:
getCurrentPositionHlp : function(component,event) {
debugger;
if (window.navigator.geolocation) {
var GeolocOptions = {
enableHighAccuracy: true,
timeout: 5000,
maximumAge: 0
};
var selfPos45 = this ;
window.navigator.geolocation.getCurrentPosition(
function(position){
debugger;
var lat = position.coords.latitude;
var lon = position.coords.longitude;
component.set('v.currentLatitude',lat);
component.set('v.currentLongitude',lon);
selfPos45.logHlp('info','GEOLOC: Set current position to '+lat+' - '+lon+ '(accuracy: ' + acc + ' meters)');
} ,
function(err){
debugger;
selfPos45.lohHlp('warning','GEOLOC ERROR:(' + err.code + '): ' + err.message);
},
GeolocOptions);
}
else
{
this.logHlp('warning','GEOLOC: Unable to get navigator current position')
}
},