Canada Crime Map - Interactive Crime Visualization
Canada Crime Map is an interactive web app that plots crime incidents across Canadian regions on a clustered map. It starts with Peel Region — Brampton, Mississauga, and Caledon — pulling live data straight from Peel Regional Police’s public ArcGIS server. No backend, no API keys, no sign-up.
What it does
Open the map and you see crime occurrences for the last 90 days grouped into numbered clusters. Zoom in and the clusters break apart into individual incidents. Click one and you get the offence type, date, municipality, and nearest street.
A filter panel lets you narrow things down:
- Date range — defaults to the last 90 days, adjustable.
- Crime category — filter to the offence types you care about.
- Municipality — focus on a single city within the region.
Offence types are color-coded consistently across the map markers, the legend, and the detail panel, so the same crime always reads the same color.
How it works
The interesting part is that there is no server of my own involved. The browser queries Peel’s ArcGIS REST FeatureServer directly:
- Live queries — the app hits the ArcGIS endpoint with CORS, paginating through results and rebuilding the query in real time as you change filters. If the live source is unreachable, it falls back to bundled demo data so the map never shows up empty.
- Clustering — handled natively by MapLibre GL JS, the open-source mapping library (no Mapbox token required).
- Caching — results are memoized in memory and persisted to
localStorage, so repeated views don’t hammer the API.
Tech stack
- SvelteKit + TypeScript for the app
- MapLibre GL JS for the map and clustering
adapter-staticto build a pure static SPA, hosted free on GitHub Pages
Because it compiles down to static files talking to a public ArcGIS layer, hosting costs nothing and there is nothing to maintain server-side.
Built to extend
The region logic is pluggable. Each police service is described by a RegionConfig object — its ArcGIS endpoint, field mappings, and offence categories — so adding another region is a matter of dropping in a new config rather than rewriting the map. Peel is the first; more can follow.
A note on the data
The incidents come from the Peel Regional Police Crime Occurrence layer, covering roughly 36 months of major crime categories as GeoJSON from ArcGIS Online. Locations are approximate — geocoded to the nearest intersection, not the exact address — so treat the map as a neighborhood-level picture, not a precise one.
Try it
- Live map: huntertran.github.io/canada-crime-map
- Source code: github.com/huntertran/canada-crime-map