Commit a5b48ba4 authored by Elisabeth Reuhl's avatar Elisabeth Reuhl
Browse files

Map: change back to using a marker ref for opening popups via table

parent 25aba0bc
......@@ -9,22 +9,18 @@ export const ReturnMarker = (props) => {
useEffect(() => {
if (openPopup) {
markerRef && markerRef.current.openPopup();
markerRef.current.openPopup();
}
}, [openPopup]);
if (!(item.coordinates||nestedItem.coordinates)) return null;
return (
<Marker
ref={markerRef}
//coordinates need to be reversed because of different standards between geojson and leaflet
position={nestedItem
? nestedItem.coordinates.split(", ").reverse()
: item.coordinates.split(", ").reverse()}
whenCreated={
markerInstance => {
markerRef.current = markerInstance
}
}
>
{nestedItem
? <ReturnPopup item={item}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment