Created
January 14, 2016 10:54
-
-
Save here-devblog-gists/a0e5ab0ceb9c691da4b0 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
function setUpClickListener(map) { | |
map.addEventListener('tap', function (evt) { | |
var coord = map.screenToGeo(evt.currentPointer.viewportX, | |
evt.currentPointer.viewportY); | |
alert('Clicked at ' + Math.abs(coord.lat.toFixed(4)) + | |
((coord.lat > 0) ? 'N' : 'S') + | |
' ' + Math.abs(coord.lng.toFixed(4)) + | |
((coord.lng > 0) ? 'E' : 'W')); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment