Created
August 24, 2015 16:39
-
-
Save mcmire/ca7fb9d3470a3b5c3a23 to your computer and use it in GitHub Desktop.
This file contains 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
getClientLocation = -> | |
new Promise (resolve, reject) -> | |
success = (position) -> | |
resolve(position.coords) | |
error = (positionError) -> | |
error = new Error("Error fetching client location: " + positionError.message) | |
reject(error) | |
navigator.geolocation.getCurrentPosition(success, error) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment