diff --git a/apps/dispatch/app/(dispatch)/_components/map/SearchElements.tsx b/apps/dispatch/app/(dispatch)/_components/map/SearchElements.tsx index 0b38f009..dc2cc159 100644 --- a/apps/dispatch/app/(dispatch)/_components/map/SearchElements.tsx +++ b/apps/dispatch/app/(dispatch)/_components/map/SearchElements.tsx @@ -5,7 +5,8 @@ import { Marker, Polygon, Polyline, Popup } from "react-leaflet"; import L from "leaflet"; export const SearchElements = () => { - const { searchElements, searchPopup, setSearchPopup } = useMapStore(); + const { searchElements, searchPopup, setSearchPopup, setPopup } = + useMapStore(); const poppupRef = useRef(null); useEffect(() => { @@ -25,9 +26,7 @@ export const SearchElements = () => { useEffect(() => { if (ref.current) { - console.log(ref.current); ref.current.on("click", () => { - console.log("click"); const center = ref.current.getBounds().getCenter(); setSearchPopup({ isOpen: true, @@ -35,7 +34,7 @@ export const SearchElements = () => { lng: center.lng, elementId: element.id, }); - console.log(element); + setPopup(null); }); } }, []); @@ -44,12 +43,16 @@ export const SearchElements = () => { [node.lat, node.lon])} - color="#46b7a3" + color={searchPopup?.elementId === element.id ? "#ff4500" : "#46b7a3"} ref={ref} /> ); }; - + console.log("searchPopup", searchPopup); + const searchPopupElement = searchElements.find( + (element) => element.id === searchPopup?.elementId, + ); + console.log("searchPopupElement", searchPopupElement); return ( <> {searchElements.map((element) => { @@ -63,8 +66,8 @@ export const SearchElements = () => { opacity={0} > -
-
test
+
+
OSM-Element
diff --git a/apps/dispatch/app/globals.css b/apps/dispatch/app/globals.css index db106d6d..bb7f5ae0 100644 --- a/apps/dispatch/app/globals.css +++ b/apps/dispatch/app/globals.css @@ -3,6 +3,11 @@ themes: dark, nord; } +@theme { + --color-rescuetrack: #46b7a3; + --color-rescuetrack-highlight: #ff4500; +} + .leaflet-popup-tip-container { display: none; } diff --git a/grafana/grafana.db b/grafana/grafana.db index 56a32b15..6f86d671 100644 Binary files a/grafana/grafana.db and b/grafana/grafana.db differ