I used following code to get user current location. This was work fine in localhost chrome and safari but I face issue with firefox. If I allow to share my location in firefox latest browser it work nicely. But I not allow, it not work. Can anyone please explain me what is the reason for that.
function getLocation() {
// Check for geolocation support
if (navigator.geolocation) {
// Get current position
navigator.geolocation.getCurrentPosition(function (position) {
// Success!
initialize(new google.maps.LatLng(position.coords.latitude, position.coords.longitude));
},
function () {
// Gelocation fallback: Defaults
initialize(new google.maps.LatLng(40.712784, -74.005941));
});
}
else {
// No geolocation fallback: Defaults
initialize(new google.maps.LatLng(40.712784, -74.005941));
}
}