Skip to content

Commit

Permalink
Fix bug with checkbox interactions
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Ory committed Feb 7, 2025
1 parent 97f2af2 commit 78620ce
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions scripts-listeners.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,27 @@
filterMarkers(); // Apply filters to markers
}

// Update the cluster display after filtering
// Ensure that individual markers are correctly shown/hidden
markers.forEach(({ marker, personID }) => {
const type = personID.substring(0, 3);
const checkboxStates = getCheckboxStates();
const show = shouldShowMarker(type, checkboxStates, {});

if (show) {
if (!map.hasLayer(marker)) {
marker.addTo(map); // Add to map if visible
}
} else {
if (map.hasLayer(marker)) {
map.removeLayer(marker); // Remove from map if hidden
}
}
});

// Refresh clusters based on new marker states
updateClusterColors();

// Trigger sidebar update after filtering
// Trigger sidebar update to reflect marker changes
updateSidebar();
}

Expand Down

0 comments on commit 78620ce

Please sign in to comment.