I am using google map geo location api. I first tested it on a local, working file on both firefox and chrome. When he moved it to the site (i.e. not https), it works fine for firefox, but doesn't work on chrome. Getting this error:
Geocoding error
Here is my code:
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var geocoder;
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(successFunction, errorFunction);
}
function successFunction(position) {
var lat = position.coords.latitude;
var lng = position.coords.longitude;
}
function errorFunction() {
alert("Geocoder failed");
}
</script>
Does chrome need a secure ssl connection for geolocation?
source
share