diff --git a/src/main/webapp/map_applications/fireblight/js/map.js b/src/main/webapp/map_applications/fireblight/js/map.js index 8aff3b4ec277ec7a1c9832b3388a57bf0ebd7550..b1aa6337b6e0641166806ddf50febc3650cf4272 100755 --- a/src/main/webapp/map_applications/fireblight/js/map.js +++ b/src/main/webapp/map_applications/fireblight/js/map.js @@ -537,13 +537,23 @@ var navigateTo = function(center) function navToLocation() { if (navigator.geolocation) { + if(window.location.protocol === "https") + { navigator.geolocation.getCurrentPosition(function(geopositionObj){ navigateTo([geopositionObj.coords.longitude, geopositionObj.coords.latitude]); } ); - } else { - alert( "Geolocation is not supported by this browser."); } + else + { + if(confirm("Lokalisering fungerer bare over https (sikker tilkobling mellom nettleser og tjener). Klikk OK for å gå til sikker tilkobling.")) + { + window.location = "https:" + window.location.href.substring(window.location.protocol.length); + } + } + } else { + alert( "Lokaliseringsfunksjonen er ikke tilgjengelig i denne nettleseren."); + } }