From 666552d0fbc38f24f560d723926aa34f7af02f81 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Tue, 10 Mar 2026 17:46:58 +0000 Subject: [PATCH] Add working map with markers for pool location --- html/template/sync/review/pool.html | 34 +++++++++++++++-------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/html/template/sync/review/pool.html b/html/template/sync/review/pool.html index cb20a83e..f1c48b8f 100644 --- a/html/template/sync/review/pool.html +++ b/html/template/sync/review/pool.html @@ -138,22 +138,24 @@ // Stub: Update map display updateMap(task) { console.log("Updating map for task:", task.id); - // TODO: Initialize/update MapLibre GL map - // Example implementation: - // if (this.map) { - // this.map.flyTo({ - // center: [task.longitude, task.latitude], - // zoom: 18 - // }); - // // Update or add marker - // } else { - // this.map = new maplibregl.Map({ - // container: 'map-container', - // style: 'https://tiles.example.com/style.json', - // center: [task.longitude, task.latitude], - // zoom: 18 - // }); - // } + const map = document.querySelector("map-multipoint"); + const loc = this.selectedTask.location; + let markers = [ + new maplibregl.Marker({ + color: "#FF0000", + draggable: false, + }).setLngLat([loc.longitude, loc.latitude]), + ]; + map.SetMarkers(markers); + + const bounds = new maplibregl.LngLatBounds( + new maplibregl.LngLat(loc.longitude - 0.01, loc.latitude - 0.01), + new maplibregl.LngLat(loc.longitude + 0.01, loc.latitude + 0.01), + ); + + map.FitBounds(bounds, { + padding: 50, + }); }, // Stub: Update aerial image display