Skip to content

Instantly share code, notes, and snippets.

@patrickarlt
Created June 10, 2014 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patrickarlt/83a6edd66273b10551c4 to your computer and use it in GitHub Desktop.
Save patrickarlt/83a6edd66273b10551c4 to your computer and use it in GitHub Desktop.
var map = new L.Map('map').setView([ 45.543, -122.621 ], 13);
map.on('click', function(e){
alert(e.latlng);
});
var polygon = L.polypolygon(latlngs).addTo(map);
polygon.on('click', function(){
if(toolIsActive){
// do something custom since a tool is active
} else {
// otherwise fire the click on the map so get the latlng
map.fire('click', e);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment