Update html/map.ejs

This commit is contained in:
ashley 2025-04-30 21:38:53 +00:00
parent 46abf16976
commit b91128ff11

View File

@ -79,21 +79,16 @@
} }
function locateAndUpdate() { function locateAndUpdate() {
const locateBtn = document.getElementById('locate-btn');
locateBtn.textContent = '⏳ Locating...';
if (!navigator.geolocation) { if (!navigator.geolocation) {
alert('Geolocation is not supported by your browser.'); alert('Geolocation is not supported by your browser.');
locateBtn.textContent = '📍 Locate';
return; return;
} }
navigator.geolocation.getCurrentPosition( navigator.geolocation.getCurrentPosition(
pos => { pos => {
updateMap(pos.coords.latitude, pos.coords.longitude); updateMap(pos.coords.latitude, pos.coords.longitude);
locateBtn.textContent = '📍 Locate';
}, },
err => { err => {
alert('Unable to retrieve location: ' + err.message); alert('Unable to retrieve location: ' + err.message);
locateBtn.textContent = '📍 Locate';
}, },
{ enableHighAccuracy: true, timeout: 10000, maximumAge: 0 } { enableHighAccuracy: true, timeout: 10000, maximumAge: 0 }
); );
@ -215,11 +210,12 @@
const branding = document.createElement('div'); const branding = document.createElement('div');
branding.textContent = 'PokeMaps'; branding.textContent = 'PokeMaps';
branding.style = 'position:fixed;bottom:10px;left:10px;padding:6px 10px;font-size:16px;font-weight:500;background:rgba(0,0,0,0.6);color:white;border-radius:6px;font-family:sans-serif;backdrop-filter:blur(6px);z-index:9999;'; branding.style = 'position:absolute;bottom:10px;left:10px;padding:6px 10px;font-size:16px;font-weight:500;background:rgba(0,0,0,0.6);color:white;border-radius:6px;font-family:sans-serif;backdrop-filter:blur(6px);z-index:9999;pointer-events:none';
document.body.appendChild(branding); document.body.appendChild(branding);
_0x4f2a(); _0x4f2a();
})(); })();
</script><script src="/static/data-mobile.js"></script> </script><script src="/static/data-mobile.js"></script>
</body> </body>
</html> </html>