Hej!
I want my popup to open via a hover/mouseover.
I tried the recommended but it still only opens on click. Does anyone have an idea what is missing?
Any help is appreciated!
import React from "react";
import { MapContainer, TileLayer, Marker, Popup } from "react-leaflet";
import L from 'leaflet';
const Map = () => {
const renderIcons = () => {
return(
<Marker
position = {[latitude, longitude]}
icon = {getIcon(markerType)}
onMouseOver = {event => event.target.openPopup()}
>
<Popup>
Hello
</Popup>
</Marker>
);
});
return(
<MapContainer ...>
<TileLayer .../>
{renderIcons()}
</MapContainer>
);
}