1
0
Fork 0
mirror of synced 2024-06-30 03:50:37 +12:00

Fix bug which prevented last marker being removed from the map if deleted

This commit is contained in:
Andrew Kingston 2022-03-25 10:59:45 +00:00
parent 7fbe2351f2
commit 3b632dea85

View file

@ -231,11 +231,15 @@
titleKey,
onClick
) => {
if (!mapInstance || !validRows?.length) {
if (!mapInstance) {
return
}
mapMarkerGroup.clearLayers()
if (!validRows?.length) {
return
}
validRows.forEach(row => {
let markerCoords = [row[latKey], row[lngKey]]
let marker = L.marker(markerCoords, mapMarkerOptions).addTo(mapInstance)