From a9a3d22ae6620210d302f27739ed74942a98d6d5 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Sat, 25 Apr 2026 17:15:53 -0500 Subject: [PATCH] feat(rover): drop highlight marker on selected candidate --- assets/js/rover_map_hook.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/assets/js/rover_map_hook.ts b/assets/js/rover_map_hook.ts index 42172366..cf928eb0 100644 --- a/assets/js/rover_map_hook.ts +++ b/assets/js/rover_map_hook.ts @@ -24,6 +24,7 @@ interface RoverMapHook extends ViewHook { homeMarker: L.CircleMarker | null driveCircle: L.Circle | null qualityLayer: L.GridLayer | null + selectedCandidateMarker: L.CircleMarker | null cellLookup: Map homeLat: number homeLon: number @@ -82,6 +83,7 @@ export const RoverMap: Partial = { this.homeMarker = null this.driveCircle = null this.qualityLayer = null + this.selectedCandidateMarker = null this.cellLookup = new Map() this.topoLayer = null @@ -210,6 +212,20 @@ export const RoverMap: Partial = { this.handleEvent("focus_cell", ( { lat, lon, zoom }: { lat: number; lon: number; zoom: number } ) => { + // Drop a single highlight marker at the picked spot, replacing + // any previous one — clicking another candidate moves it. + if (this.selectedCandidateMarker) { + this.map.removeLayer(this.selectedCandidateMarker) + } + this.selectedCandidateMarker = L.circleMarker([lat, lon], { + radius: 8, + color: "#0ea5e9", + weight: 2, + fillColor: "#0ea5e9", + fillOpacity: 0.6, + pane: "markerPane" + }).addTo(this.map) + this.map.flyTo([lat, lon], zoom, { duration: 0.6 }) }) },