How imran5209/emerjencyservices works
This is a browser-based emergency medical and services locator. Users view their location, discover nearby hospitals, clinics, police and fire services, inspect facility details, filter results, and request a route with turn-by-turn instructions; emergency contact numbers are also displayed. The main runtime is concentrated in script.js, with offline asset caching handled separately by the service worker. The excerpts establish the Overpass query, map rendering and route/list interactions, but do not show the HTML wiring or location acquisition, so those connections are omitted.
Main entry points: script.js Service list and filters · sw.js Service worker · index.html Application page
Components 14
Nearby discovery
- Application page
index.html - Nearby service search
script.js - Service list and filters
script.js - Facility details
script.js
Map and routing
- Location and map state
script.js - Service markers
script.js - Route planning and directions
script.js
Emergency information
- Emergency contacts
script.js
Offline support
- Service worker
sw.js - Cache Storage
Other components
- App user
- Browser runtime
- OpenStreetMap Overpass API
- Leaflet routing plugin
Connections 11
- Nearby service search → OpenStreetMap Overpass API: queries
script.js - Nearby service search → Service markers: renders results
script.js - Nearby service search → Service list and filters: renders results
script.js - Service list and filters → Service markers: opens marker
script.js - Service list and filters → Route planning and directions: requests route
script.js - Location and map state → Service markers: renders location
script.js - Route planning and directions → Leaflet routing plugin: configures routing
script.js - Route planning and directions → Service list and filters: renders directions
script.js - Emergency contacts → Application page: displays numbers
script.js - Browser runtime → Service worker: dispatches lifecycle events
sw.js - Service worker → Cache Storage: reads and writes
sw.js