I am expericing this error, while trying to use the geolocation api:
This website does not have permission to use the Geolocation API
The strange thing is that the same website is running fine on one some systems(where IE.9 and I.E10 are installed) and it throws error on a system where I.E 9 is installed.
We tested it on different systems but it throws error only on that particular system where I.E9 is installed.
- Do we need some browser settings to use this API?
- What persmission do we require for our website, to use the geolocation API?
Code:
function geolocateUser()
{
// If the browser supports the Geolocation API
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(geolocationSuccess, geolocationError);
}
else {
alert("Your browser doesn't support the Geolocation API");
}
}
In case of success:
function geolocationSuccess(position) {
var userCurrentLatLong = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
}
In case of error:
function geolocationError(positionError) {
alert(positionError.message + "\n" + "you will be redirected to default location.");
}