L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© OpenStreetMap contributors'
}).addTo(map);
// Load your GeoJSON file from GitHub
fetch('https://github.com/sjc2partnership-maker/Daycare/blob/main/Daycares%20for%20TAT%20v2.json')
.then(response => response.json())
.then(data => {
var layer = L.geoJSON(data, {
onEachFeature: function (feature, layer) {
var p = feature.properties;
var popup = `
${p.Name || ''}
${p.Category || ''}
${p.Address || ''}
${p.City || ''}, ${p.State || ''} ${p.Zip || ''}
${p.Phone || ''} `; layer.bindPopup(popup); } }).addTo(map); // Zoom map to fit all pins map.fitBounds(layer.getBounds(), { padding: [20, 20] }); }) .catch(error => console.error('Error loading GeoJSON:', error)); });
${p.Category || ''}
${p.Address || ''}
${p.City || ''}, ${p.State || ''} ${p.Zip || ''}
${p.Phone || ''} `; layer.bindPopup(popup); } }).addTo(map); // Zoom map to fit all pins map.fitBounds(layer.getBounds(), { padding: [20, 20] }); }) .catch(error => console.error('Error loading GeoJSON:', error)); });