#46 Einsatz-Marker & Chat/Report disabled wenn nicht verbunden
This commit is contained in:
@@ -53,7 +53,7 @@ export const ContextMenu = () => {
|
||||
|
||||
if (!contextMenu || !dispatcherConnected) return null;
|
||||
|
||||
const einsatzBtnText = missionFormValues && isOpen ? "Position übernehmen" : "Einsatz erstellen";
|
||||
const missionBtnText = missionFormValues && isOpen ? "Position übernehmen" : "Einsatz erstellen";
|
||||
|
||||
const addOSMobjects = async (ignorePreviosSelected?: boolean) => {
|
||||
const res = await fetch(
|
||||
@@ -108,7 +108,7 @@ export const ContextMenu = () => {
|
||||
{/* Top Button */}
|
||||
<button
|
||||
className="btn btn-circle bg-rescuetrack w-10 h-10 absolute left-1/2 top-0 pointer-events-auto opacity-80 tooltip tooltip-top tooltip-accent"
|
||||
data-tip={einsatzBtnText}
|
||||
data-tip={missionBtnText}
|
||||
style={{ transform: "translateX(-50%)" }}
|
||||
onClick={async () => {
|
||||
const { parsed } = await getOsmAddress(contextMenu.lat, contextMenu.lng);
|
||||
|
||||
@@ -12,6 +12,7 @@ import { MarkerCluster } from "_components/map/_components/MarkerCluster";
|
||||
import { useEffect, useRef } from "react";
|
||||
import { Map as TMap } from "leaflet";
|
||||
import { DistanceLayer } from "_components/map/Measurement";
|
||||
import { MapAdditionals } from "_components/map/MapAdditionals";
|
||||
|
||||
const Map = () => {
|
||||
const ref = useRef<TMap | null>(null);
|
||||
@@ -48,6 +49,7 @@ const Map = () => {
|
||||
<MissionLayer />
|
||||
<AircraftLayer />
|
||||
<DistanceLayer />
|
||||
<MapAdditionals />
|
||||
</MapContainer>
|
||||
);
|
||||
};
|
||||
|
||||
20
apps/dispatch/app/_components/map/MapAdditionals.tsx
Normal file
20
apps/dispatch/app/_components/map/MapAdditionals.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
"use client";
|
||||
import { usePannelStore } from "_store/pannelStore";
|
||||
import { Marker } from "react-leaflet";
|
||||
import L from "leaflet";
|
||||
|
||||
export const MapAdditionals = () => {
|
||||
const missionForm = usePannelStore((state) => state.missionFormValues);
|
||||
|
||||
if (!missionForm?.addressLat || !missionForm?.addressLng) return null;
|
||||
|
||||
return (
|
||||
<>
|
||||
<Marker
|
||||
position={[missionForm.addressLat, missionForm.addressLng]}
|
||||
icon={L.icon({ iconUrl: "/icons/mapMarker.png", iconSize: [40, 40], iconAnchor: [20, 35] })}
|
||||
interactive={false}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user