I'd like to display a summary popup when hover over a marker and close it when leaving the marker.
When clicking on ta marker, I want to display a details popup, which should stay open until clicking again or hover over another marker.
Here is my code, which does not work. It does nothing on click.
// Tooltip on mouse over
marker.on('mouseover click', function(event) {
if (event.type == "mouseover") {
console.log("mouseover");
marker.bindPopup(
feature.properties.name, {'offset': L.point(0,-15)}).openPopup();
} else if (event.type == "click") {
console.log("click");
cliquer();
marker.bindPopup(
feature.properties.name + '<br/>' + feature.properties.desc + '<br/>' + latlng + 'Additional Information,
{'offset': L.point(0,-15)}).openPopup();
};
});
marker.on('mouseout', function(){marker.closePopup();});
return marker;