|
|
@ -56,24 +56,18 @@ export default function OpenStreetMap({ |
|
|
|
renderOptions: dataOptionsToShow, |
|
|
|
}); |
|
|
|
|
|
|
|
// markersList &&
|
|
|
|
// mapRef &&
|
|
|
|
// notEmpy(markersList) &&
|
|
|
|
// markersList.forEach((val, _) => {
|
|
|
|
// // console.log(val);
|
|
|
|
// insertMarker(mapRef, val.ID, val.coordinate, val.image);
|
|
|
|
// });
|
|
|
|
|
|
|
|
// console.log(markersList)
|
|
|
|
useEffect(() => { |
|
|
|
if (markersList && mapRef) { |
|
|
|
deleteAllMarkers(mapRef); |
|
|
|
|
|
|
|
notEmpy(markersList) && |
|
|
|
markersList.forEach((val, k) => { |
|
|
|
if (val[1].name == "susceptibilityAreas") { |
|
|
|
insertPolygon(mapRef, val[1].ID, val[1].coordinate); |
|
|
|
markersList.forEach((val) => { |
|
|
|
if (val.name == "susceptibilityAreas") { |
|
|
|
insertPolygon(mapRef, val.ID, val.coordinate); |
|
|
|
} else { |
|
|
|
insertMarker(mapRef, val[1].ID, val[1].coordinate, val[1].image); |
|
|
|
insertMarker(mapRef, val.ID, val.coordinate, val.image); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
@ -104,7 +98,7 @@ export default function OpenStreetMap({ |
|
|
|
<MapModal |
|
|
|
showModal={markerListener} |
|
|
|
setShowModal={setMarkerListener} |
|
|
|
markers={markersList} |
|
|
|
markers={markers.markers} |
|
|
|
/> |
|
|
|
|
|
|
|
<MapDataMenu |
|
|
|