Skip to content

Instantly share code, notes, and snippets.

@vseventer
Created July 30, 2012 13:09
Show Gist options
  • Select an option

  • Save vseventer/3206763 to your computer and use it in GitHub Desktop.

Select an option

Save vseventer/3206763 to your computer and use it in GitHub Desktop.
Save the devices current position to Kinvey.
navigator.geolocation.getCurrentPosition(function(position) {
var coords = position.coords;
var entity = new Kinvey.Entity({
_geoloc: [coords.longitude, coords.latitude]
}, 'test-collection');
entity.save({
success: function(entity) {
// entity is now saved.
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment