The method for adding markers to a map with the Leaflet "click" event handler is:
Here is an example code snippet:
map.on('click', function(event) {
var marker = L.marker(event.latlng);
// add popup content
marker.bindPopup("<b>Hello World!</b><br>I am a popup.").openPopup();
map.addLayer(marker);
});
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2022-02-20 11:00:00 +0000
Seen: 9 times
Last updated: Nov 12 '22
How to add a Tapped event to the CheckBox control in Xamarin.Forms?
How can I detect the fullscreen button click event of an HTML5 video?
Why does the alert appear only when I click on something else?
How can I obtain comprehensive logs for Amazon Cognito after an unsuccessful authentication attempt?
Does BlobClient.OpenWriteAsync produce several BlobCreated occurrences?
Why isn't my CodePipeline pipeline triggered by my CloudWatch Event rule?
Is it impossible to prevent event propagation in vuedraggable?
How can an event table be created utilizing FSCalendar?
What is the process for including a delete button in a row that can be clicked?