diff --git a/app.js b/app.js index 67dfc65..904114f 100644 --- a/app.js +++ b/app.js @@ -158,6 +158,7 @@ function addSightMarker(sight, number) { // Create popup content for markers function createPopupContent(sight) { const icon = categoryIcons[sight.category] || "📍"; + const isSelected = selectedSights.has(sight.id); return ` `; @@ -278,7 +283,13 @@ function toggleSightSelection(sightId) { } else { selectedSights.add(sightId); } - + + // Update the popup content for this sight's marker + const marker = markers.find(m => m.sightData && m.sightData.id === sightId); + if (marker) { + marker.setPopupContent(createPopupContent(marker.sightData)); + } + updateRouteDisplay(); renderSightsList(getCurrentFilter(), getCurrentSearch()); }