Skip to content

Instantly share code, notes, and snippets.

@chrismetcalf
Last active August 29, 2015 13:56
Show Gist options
  • Save chrismetcalf/8798876 to your computer and use it in GitHub Desktop.
Save chrismetcalf/8798876 to your computer and use it in GitHub Desktop.
simply.js Fire911 lookup
simply.title('Locating...');
navigator.geolocation.getCurrentPosition(function(pos) {
var coords = pos.coords;
simply.title('Looking up ' + coords.latitude + ', ' + coords.longitude);
var fire_url = 'http://data.seattle.gov/resource/kzjm-xkqj.json?' +
'$where=within_circle(report_location, ' + coords.latitude + ', ' + coords.longitude + ', 500)&$limit=20';
simply.body(fire_url, true);
ajax({ url: fire_url, type: 'json' }, function(data) {
simply.body('Got something', true);
//simply.text({ title: data.count, subtitle: data.count });
},
function(data) {
simply.title('Something went wrong');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment