GetcurrentPosition não funciona depois de implantado
Estou tentando inicializar um mapa centralizado e com um marcador na posição atual do usuário. No local está tudo bem, mas quando implanto a página html no Google Appengine, ela mostra apenas o mapa sem a geolocalização ... Onde estou errado? Obrigado!
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);
});
}