diff --git a/html/map.ejs b/html/map.ejs index 2f57b813..08b4075e 100644 --- a/html/map.ejs +++ b/html/map.ejs @@ -78,6 +78,18 @@ }); } + function locateAndUpdate() { + if (!navigator.geolocation) { + alert('Geolocation is not supported by your browser.'); + return; + } + navigator.geolocation.getCurrentPosition( + pos => updateMap(pos.coords.latitude, pos.coords.longitude), + err => alert('Unable to retrieve location: ' + err.message), + { enableHighAccuracy: true, timeout: 10000, maximumAge: 0 } + ); + } + function _0x4f2a(){ const bbox = _0x99f2(0); const base = _0x99f2(1); @@ -138,7 +150,7 @@
- +