Spaces:
Running
Running
Download script.js from Arrel18/mapquest-navigator: direct link, hf CLI and curl.
- Browser
- Download file 680 Bytes
-
https://huggingface.co/spaces/Arrel18/mapquest-navigator/resolve/main/script.js
- Command line
-
hf download hf://spaces/Arrel18/mapquest-navigator/script.js
-
curl -L -o script.js https://huggingface.co/spaces/Arrel18/mapquest-navigator/resolve/main/script.js
680 Bytes
| // Shared JavaScript functionality | |
| document.addEventListener('DOMContentLoaded', () => { | |
| // Check for geolocation support | |
| if (navigator.geolocation) { | |
| navigator.geolocation.getCurrentPosition( | |
| (position) => { | |
| console.log('User location:', position.coords.latitude, position.coords.longitude); | |
| // You can center the map on the user's location here | |
| }, | |
| (error) => { | |
| console.error('Error getting location:', error); | |
| } | |
| ); | |
| } else { | |
| console.log('Geolocation is not supported by this browser.'); | |
| } | |
| // Any other shared functionality can go here | |
| }); |