Making Leaflet tooltip clickable
问题 I want to add tooltips on a Leaflet map (without markers) and make them clickable. The following code adds a tooltip but it's not clickable: var tooltip = L.tooltip({ direction: 'center', permanent: true, interactive: true, noWrap: true, opacity: 0.9 }); tooltip.setContent( "Example" ); tooltip.setLatLng(new L.LatLng(someLat, someLon)); tooltip.addTo(myLayer); tooltip.on('click', function(event) { console.log("Click!"); }); How can I make it work? 回答1: To receive clicks on a L.Tooltip object,