Skip to content

Commit f714eb8

Browse files
committed
Add active marker highlighting and hide popup when details panel is shown
1 parent 3d7d84d commit f714eb8

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

pcd-website/src/components/MapView.vue

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,23 @@ function onStyleChange(styleId: string) {
9393
if (mapInstance && leafletRef) setMapStyle(styleId, mapInstance, leafletRef);
9494
}
9595
96+
function setActiveMarker(nodeId: string | null) {
97+
markerMap.forEach((marker, id) => {
98+
marker.getElement()?.classList.toggle('marker-active', id === nodeId);
99+
});
100+
}
101+
96102
function openPanel(node: Node) {
97103
selectedNode.value = node;
98104
listOpen.value = false;
105+
const marker = markerMap.get(node.id);
106+
marker?.closePopup();
107+
setActiveMarker(node.id);
99108
}
100109
101110
function closePanel() {
102111
selectedNode.value = null;
112+
setActiveMarker(null);
103113
}
104114
105115
function openList() {
@@ -200,9 +210,8 @@ onMounted(async () => {
200210
},
201211
});
202212
203-
// Custom red SVG marker
204213
const markerIcon = L.divIcon({
205-
className: '',
214+
className: 'marker-node',
206215
html: `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
207216
<circle cx="10" cy="10" r="8" fill="#5601A4" stroke="#fff" stroke-width="2"/>
208217
</svg>`,
@@ -278,3 +287,16 @@ onUnmounted(() => {
278287
z-index: 0;
279288
}
280289
</style>
290+
291+
<style>
292+
.marker-node.marker-active svg {
293+
overflow: visible;
294+
filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 10px rgba(86, 1, 164, 0.9));
295+
transform: scale(1.4);
296+
transform-origin: center;
297+
}
298+
299+
.marker-node.marker-active svg circle {
300+
stroke-width: 3.5;
301+
}
302+
</style>

0 commit comments

Comments
 (0)