diff --git a/apps/dispatch/app/dispatch/_components/map/ContextMenu.tsx b/apps/dispatch/app/dispatch/_components/map/ContextMenu.tsx
index e8247ef0..401614f6 100644
--- a/apps/dispatch/app/dispatch/_components/map/ContextMenu.tsx
+++ b/apps/dispatch/app/dispatch/_components/map/ContextMenu.tsx
@@ -2,8 +2,16 @@
import { OSMWay } from "@repo/db";
import { useMapStore } from "_store/mapStore";
import { usePannelStore } from "_store/pannelStore";
-import { MapPinned, Search } from "lucide-react";
-import { useEffect } from "react";
+import {
+ MapPin,
+ MapPinned,
+ Radius,
+ Ruler,
+ Search,
+ RulerDimensionLine,
+ Scan,
+} from "lucide-react";
+import { useEffect, useState } from "react";
import { Popup, useMap } from "react-leaflet";
export const ContextMenu = () => {
@@ -11,11 +19,19 @@ export const ContextMenu = () => {
const { contextMenu, setContextMenu, setSearchElements, setSearchPopup } =
useMapStore();
const { setMissionFormValues, setOpen } = usePannelStore((state) => state);
+ const [showRulerOptions, setShowRulerOptions] = useState(false);
+ const [rulerHover, setRulerHover] = useState(false);
+ const [rulerOptionsHover, setRulerOptionsHover] = useState(false);
+
+ useEffect(() => {
+ setShowRulerOptions(rulerHover || rulerOptionsHover);
+ }, [rulerHover, rulerOptionsHover]);
+
useEffect(() => {
const handleContextMenu = (e: any) => {
setContextMenu({ lat: e.latlng.lat, lng: e.latlng.lng });
};
- const handleClick = (e: any) => {
+ const handleClick = () => {
setContextMenu(null);
setSearchPopup(null);
};
@@ -27,7 +43,7 @@ export const ContextMenu = () => {
map.off("contextmenu", handleContextMenu);
map.off("click", handleClick);
};
- }, [contextMenu]);
+ }, [map, contextMenu, setContextMenu, setSearchPopup]);
if (!contextMenu) return null;
@@ -76,86 +92,242 @@ export const ContextMenu = () => {
autoPan={false}
>
{/* // TODO: maske: */}
-
-