Skip to content

Instantly share code, notes, and snippets.

@zuk
Created April 4, 2012 20:05
Show Gist options
  • Select an option

  • Save zuk/2305192 to your computer and use it in GitHub Desktop.

Select an option

Save zuk/2305192 to your computer and use it in GitHub Desktop.
var r = new veos.model.Reports(); // creates the "reports" collection proxy object
r.on('reset', function(collection) {
navigator.geolocation.getCurrentPosition(function(currentLocation) {
var collectionFilter = function(installation) {
return isCloseBy(installation, currentLocation);
}
var filteredReports = _.filter(collection, collectionFilter);
createGrid(filteredReports);
},
failureHandler
)
});
// @triggers reset on the collection
r.fetch();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment