Created
July 30, 2012 13:09
-
-
Save vseventer/3206763 to your computer and use it in GitHub Desktop.
Save the devices current position to Kinvey.
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
| 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