Maryland Applied Behavior Analysis Therapist | Move Up ABA

Importance of Routine in Autism

`) .addTo(markers); markerMap[`${loc.coords[0]}_${loc.coords[1]}`] = m; }); function haversine(lat1, lon1, lat2, lon2) { const R = 3958.8; const toRad = x => x * Math.PI / 180; const dLat = toRad(lat2 - lat1); const dLon = toRad(lon2 - lon1); const a = Math.sin(dLat/2)**2 + Math.cos(toRad(lat1)) * Math.cos(toRad(lat2)) * Math.sin(dLon/2)**2; return R * 2 * Math.asin(Math.sqrt(a)); } const serviceMessage = `

We provide services in your area. Contact us today to learn more about our programs and how we can support your child’s growth and development.

Contact Us Today
`; window.performSearch = function() { const query = document.getElementById('location-search').value.trim(); if (!query) return; // Clear previous route & marker routes.clearLayers(); if (routeControl) { map.removeControl(routeControl); routeControl = null; } if (userMarker) { map.removeLayer(userMarker); userMarker = null; } const match = locations.find(l => l.name.toLowerCase().includes(query.toLowerCase())); if (match) { map.setView(match.coords, 13); markerMap[`${match.coords[0]}_${match.coords[1]}`].openPopup(); return; } fetch(`https://nominatim.openstreetmap.org/search?format=json&limit=1&q=${encodeURIComponent(query + ', Maryland')}`) .then(r => r.json()) .then(data => { if (!data || data.length === 0) { map.setView([39.0458, -76.6413], 8); L.popup().setLatLng([39.0458, -76.6413]).setContent(serviceMessage).openOn(map); return; } const lat = parseFloat(data[0].lat); const lon = parseFloat(data[0].lon); const userCoords = [lat, lon]; userMarker = L.circleMarker(userCoords, { radius: 10, color: '#d32f2f', fillColor: '#ff5252', fillOpacity: 1, weight: 2 }).addTo(map); let nearest = null; let minDist = Infinity; locations.forEach(loc => { const d = haversine(userCoords[0], userCoords[1], loc.coords[0], loc.coords[1]); if (d null, lineOptions: { styles: [{ color: '#062944', weight: 8, opacity: 0.9 }] }, addWaypoints: false, routeWhileDragging: false, show: false, router: L.Routing.osrmv1({ serviceUrl: 'https://router.project-osrm.org/route/v1' }) }).addTo(map); markerMap[`${nearest.coords[0]}_${nearest.coords[1]}`].openPopup(); L.popup() .setLatLng(nearest.coords) .setContent(`
${nearest.name}
${Math.round(nearest.distance)} miles away
${serviceMessage}
`) .openOn(map); } else { map.setView([39.0458, -76.6413], 8); L.popup().setLatLng([39.0458, -76.6413]).setContent(serviceMessage).openOn(map); } }) .catch(() => { map.setView([39.0458, -76.6413], 8); L.popup().setLatLng([39.0458, -76.6413]).setContent(serviceMessage).openOn(map); }); }; document.getElementById('location-search').addEventListener('keypress', e => { if (e.key === 'Enter') performSearch(); }); });