Using Angular here. I have a marker on a leaflet map.
const marker = L.marker([34.5, -0.45]).addTo(this.map);
marker.bindPopup("I'm a marker");
When I go to the map, click this marker and then click the close button, it refreshes the page. I want to disable the redirecting when the close button is pressed so I thought I would try:
marker.addEventListener('click', event => {event.preventDefault();
});
But the property doesn't exist for type LeafletMouseEvent
What is the proper way to do this?