I am trying to use the Flyer to get the coordinates of the map where the user right-clicked. I went through the Leaflet API and still realized that I needed to listen for the contextmenu event and use the mouseEventToLatLng method to get the coordinates when clicked. However, when I look through and debug my code, I do not see the latLng variable available anywhere. Am I missing an understanding of something in the API?
function setMarkers() { document.getElementById("transitmap").addEventListener("contextmenu", function( event ) {
javascript leaflet
tylerbhughes
source share