Skip to content

Instantly share code, notes, and snippets.

@martinshaw
Created July 15, 2013 14:42
Show Gist options
  • Save martinshaw/6000488 to your computer and use it in GitHub Desktop.
Save martinshaw/6000488 to your computer and use it in GitHub Desktop.
Location Services embedded into posts
$ ->
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