Last active
August 29, 2015 13:56
-
-
Save chrismetcalf/8798876 to your computer and use it in GitHub Desktop.
simply.js Fire911 lookup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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