// 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 });