Skip to content

Instantly share code, notes, and snippets.

@usmaanalii
Created August 21, 2017 07:48
Show Gist options
  • Save usmaanalii/2fec70ae96a19d1531bc04b1c54a9664 to your computer and use it in GitHub Desktop.
Save usmaanalii/2fec70ae96a19d1531bc04b1c54a9664 to your computer and use it in GitHub Desktop.

What I learned on this mini-project.

geolocation

This is a property of the window object, that contains data about the users location. You must grant access for it to work.

https://gist.github.com/2997906a5a09b9c1d8cd090468a9b72f

The geolocation object is only introduced very briefly, in this project.

watchPosition

This method, allows you to update the users position at regular intervals, instead of getting periodic snapshots of their locations.

The data then needs to be manipulated through a promise, designed to handle successful or unsuccessful data retrieval.

https://gist.github.com/d163d1ac55e1341854e2c9819668af8a

coords

Most of the data that you will need is contained in this object. Examples of this include the latitude, longitude and heading (representing degrees from north).

https://gist.github.com/d0f31f58759b79f4c5a31553955d9e87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment