I'm trying to initialize a Map centered and with a marker on current user's position. In local everything fine, but when i deploy the html page to Google Appengine, it shows just the map without the geolocalization... Where I'm wrong? Thanks!
var marker;
function initAutocomplete() {
var map = new google.maps.Map(document.getElementById('map'), {
center: {lat: 44.415, lng: 10.374},
zoom: 13,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function (position) {
initialLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
map.setCenter(initialLocation);
marker = new google.maps.Marker({
icon: 'http://maps.google.com/mapfiles/ms/icons/green-dot.png',
map: map,
draggable: true,
animation: google.maps.Animation.DROP,
position: {lat: position.coords.latitude, lng: position.coords.longitude}
});
marker.addListener('click', toggleBounce);
});
}
getCurrentPosition() and watchPosition() are deprecated on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See
sites.google.com/a/chromium.org/dev/Home/chromium-security/…for more details.
– Pinchcock