Hello I made a web app that shows the current location, the final destination and some waypoints in between that the user needs to visit. Since some days google changed something about its privacy? And now it doesnt load my map anymore. The only error i get is
getCurrentPosition() and watchPosition() are deprecated on insecure origins, and support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.
I followed the link but i don't get any wiser of it. The fiddle of my code is here:
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
curLoc = new google.maps.LatLng(
position.coords.latitude,
position.coords.longitude
);
var request = {
origin: curLoc,
destination: fabriek,
travelMode: google.maps.TravelMode.DRIVING,
waypoints: waypts,
optimizeWaypoints: true
};
var infowindow = new google.maps.InfoWindow({
content: "Dit ben jij"
});
var bestuurderIcon = new google.maps.MarkerImage('marker-bestuurder.png',
null,
null,
null,
new google.maps.Size(40, 50));
var marker = new google.maps.Marker({
position: curLoc,
icon: bestuurderIcon,
map: map,
title: 'Dit ben jij',
animation: google.maps.Animation.DROP
});
marker.addListener('click', function() {
infowindow.open(map, marker);
});
directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(response);
// navigeer naar volgende punt met google applicatie op device
document.getElementById("gohere").href = "google.navigation:q=" + response.routes[0].legs[0].end_address;
}
});
});
}