diff --git a/apps/dispatch/app/_components/map/ContextMenu.tsx b/apps/dispatch/app/_components/map/ContextMenu.tsx
index d4b70496..7d65038f 100644
--- a/apps/dispatch/app/_components/map/ContextMenu.tsx
+++ b/apps/dispatch/app/_components/map/ContextMenu.tsx
@@ -13,6 +13,8 @@ import {
Scan,
Car,
Ambulance,
+ Siren,
+ Flame,
} from "lucide-react";
import { getOsmAddress } from "_querys/osm";
import { useEffect, useState } from "react";
@@ -43,15 +45,16 @@ export const ContextMenu = () => {
setOpen,
isOpen: isPannelOpen,
} = usePannelStore((state) => state);
- const [showRulerOptions, setShowRulerOptions] = useState(false);
+ const [showObjectOptions, setShowObjectOptions] = useState(false);
const [rulerHover, setRulerHover] = useState(false);
const [rulerOptionsHover, setRulerOptionsHover] = useState(false);
const dispatcherConnected = useDispatchConnectionStore((s) => s.status) === "connected";
useEffect(() => {
- setShowRulerOptions(rulerHover || rulerOptionsHover);
- }, [rulerHover, rulerOptionsHover]);
+ const showObjectOptions = rulerHover || rulerOptionsHover;
+ setShowObjectOptions(showObjectOptions);
+ }, [isPannelOpen, rulerHover, rulerOptionsHover, setOpen]);
useEffect(() => {
const handleContextMenu = (e: any) => {
@@ -198,8 +201,8 @@ export const ContextMenu = () => {
>
- {/* Ruler Options - shown when Ruler button is hovered or options are hovered */}
- {showRulerOptions && (
+ {/* XPlane Object Options - shown when Ruler button is hovered or options are hovered */}
+ {showObjectOptions && (
setRulerOptionsHover(true)}
@@ -207,8 +210,8 @@ export const ContextMenu = () => {
>
{
console.log("Add Ambulance");
setMissionFormValues({
@@ -216,7 +219,7 @@ export const ContextMenu = () => {
xPlaneObjects: [
...(missionFormValues?.xPlaneObjects ?? []),
{
- objectName: "test",
+ objectName: "ambulance",
alt: 0,
lat: contextMenu.lat,
lon: contextMenu.lng,
@@ -229,21 +232,45 @@ export const ContextMenu = () => {
{
- /* ... */
+ console.log("Add fire engine");
+ setMissionFormValues({
+ ...missionFormValues,
+ xPlaneObjects: [
+ ...(missionFormValues?.xPlaneObjects ?? []),
+ {
+ objectName: "fire_engine",
+ alt: 0,
+ lat: contextMenu.lat,
+ lon: contextMenu.lng,
+ },
+ ],
+ });
}}
>
-
+
{
- /* ... */
+ console.log("Add police");
+ setMissionFormValues({
+ ...missionFormValues,
+ xPlaneObjects: [
+ ...(missionFormValues?.xPlaneObjects ?? []),
+ {
+ objectName: "police",
+ alt: 0,
+ lat: contextMenu.lat,
+ lon: contextMenu.lng,
+ },
+ ],
+ });
}}
>
-
+
diff --git a/apps/dispatch/app/_components/map/MapAdditionals.tsx b/apps/dispatch/app/_components/map/MapAdditionals.tsx
index f60a2829..6dea267e 100644
--- a/apps/dispatch/app/_components/map/MapAdditionals.tsx
+++ b/apps/dispatch/app/_components/map/MapAdditionals.tsx
@@ -8,6 +8,8 @@ import { HPGValidationRequired } from "_helpers/hpgValidationRequired";
import { getConnectedAircraftsAPI } from "_querys/aircrafts";
import { useMapStore } from "_store/mapStore";
import { useDispatchConnectionStore } from "_store/dispatch/connectionStore";
+import { is } from "date-fns/locale";
+import { XplaneObject } from "@repo/db";
export const MapAdditionals = () => {
const { isOpen, missionFormValues } = usePannelStore((state) => state);
@@ -53,6 +55,20 @@ export const MapAdditionals = () => {
interactive={false}
/>
)}
+ {isOpen &&
+ missionFormValues?.xPlaneObjects &&
+ (missionFormValues.xPlaneObjects as unknown as XplaneObject[]).map((obj, index) => (
+
+ ))}
{markersNeedingAttention.map((mission) => (
{
return missionStationIds?.some((id) => {
const aircraft = aircrafts?.find((a) => a.stationId === id);
-
return aircraft?.posXplanePluginActive;
});
};
diff --git a/apps/dispatch/public/icons/ambulance.png b/apps/dispatch/public/icons/ambulance.png
new file mode 100644
index 00000000..114a9abf
Binary files /dev/null and b/apps/dispatch/public/icons/ambulance.png differ
diff --git a/apps/dispatch/public/icons/fire_engine.png b/apps/dispatch/public/icons/fire_engine.png
new file mode 100644
index 00000000..2f11c4e4
Binary files /dev/null and b/apps/dispatch/public/icons/fire_engine.png differ
diff --git a/apps/dispatch/public/icons/police.png b/apps/dispatch/public/icons/police.png
new file mode 100644
index 00000000..bd0132c4
Binary files /dev/null and b/apps/dispatch/public/icons/police.png differ