I'm using laravel with a virtualhost and I need to make the map work on localhost, but I already have the google key and even then, without putting the restrictions on the key, the message still appears. How do I make Map work in the localhost environment? Here is the location code that shows the message:
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function (position) {
var pos = {
lat: position.coords.latitude,
lng: position.coords.longitude
};
infoWindow.setPosition(pos);
infoWindow.setContent('Esta é a sua localização.');
map.setCenter(pos);
}, function () {
handleLocationError(true, infoWindow, map.getCenter());
});
} else {
// Browser não suporta localização
handleLocationError(false, infoWindow, map.getCenter());
}