Created
December 26, 2014 14:29
-
-
Save mgax/ec24ae4a971f623b876a to your computer and use it in GitHub Desktop.
get coordinates by clicking on d3 svg map
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
svg.on('click', function() { | |
var coord = projection.invert([d3.event.x, d3.event.y]); | |
window.prompt('copy', '['+[d3.round(coord[0], 2), d3.round(coord[1], 2)]+']'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment