most recent police incident responses in seattle plotted on a map.
JavaScript CSS HTML
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
_site
css
js
.DS_Store
CNAME
README.md
_config.yml
index.html

README.md

Seattle Fire Dept. 911 dispatches plotted on a map.

Part of seattle.io

This demo uses data from data.seattle.gov.

The dataset is Seattle Real Time Fire 911 Calls on data.seattle.gov. The Seattle data site uses Socrata for their dataset management, and they have a fairly easy to use api. Check out the api docs.

I used jquery to make a jsonp ajax request:

$.getJSON('http://data.seattle.gov/api/views/kzjm-xkqj/rows.json?jsonp=?&max_rows=10', function(results) { ... }

Weird thing about the jsonp request: I couldn’t find anything in any Socrata docs about jsonp, but found this example repo on somebody’s Github account. It works, so that’s cool.

The json gets plopped onto a map using Leaflet. Leaflet is crazy easy to use. Especially since they released version 0.4.

I used moment.js to turn the UNIX timestamp of each dispatch into a human readable date format.

The site is hosted using Github Pages at fire.seattle.io.