Created
July 15, 2013 14:42
-
-
Save martinshaw/6000488 to your computer and use it in GitHub Desktop.
Location Services embedded into posts
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
$ -> | |
composer= composer or {} | |
composer.locationservices= | |
showPosition: (position) -> | |
document.geoclocation=[ | |
position.coords.latitude | |
position.coords.longitude | |
] | |
getlocation: -> | |
if navigator.geolocation | |
navigator.geolocation.getCurrentPosition composer.locationservices.showPosition | |
else | |
console.log "Geolocation is not supported by this browser." | |
alert composer.locationservices.getlocation() | |
yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment