document.addEventListener('DOMContentLoaded', function() { const mapContainer = document.getElementById('map'); if (!mapContainer) return; const lat = parseFloat(mapContainer.dataset.lat); const lng = parseFloat(mapContainer.dataset.lng); const name = mapContainer.dataset.name; if (isNaN(lat) || isNaN(lng)) return; const map = L.map('map').setView([lat, lng], 13); L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap contributors' }).addTo(map); L.marker([lat, lng]) .addTo(map) .bindPopup(name); });