From 19f036d0c3301e3095efa6d5032809dd3eb00ef1 Mon Sep 17 00:00:00 2001 From: PxlLoewe <72106766+PxlLoewe@users.noreply.github.com> Date: Fri, 25 Apr 2025 17:37:34 -0700 Subject: [PATCH] did something with markers --- apps/dispatch/app/_components/SmartPopup.tsx | 7 +++++++ .../_components/map/AircraftMarker.tsx | 3 ++- .../dispatch/_components/map/ContextMenu.tsx | 6 ++---- .../_components/map/MissionMarkers.tsx | 2 ++ .../map/_components/MarkerCluster.tsx | 3 --- grafana/grafana.db | Bin 1122304 -> 1122304 bytes .../prisma/schema/connectedAircraft.prisma | 15 +++++++++++++++ .../prisma/schema/connectedDispatch.prisma | 12 ++++++++++++ .../database/prisma/schema/positionLog.prisma | 13 +++++++++++++ .../database/prisma/schema/station.prisma | 1 + packages/database/prisma/schema/user.prisma | 3 +++ 11 files changed, 57 insertions(+), 8 deletions(-) create mode 100644 packages/database/prisma/schema/connectedAircraft.prisma create mode 100644 packages/database/prisma/schema/connectedDispatch.prisma create mode 100644 packages/database/prisma/schema/positionLog.prisma diff --git a/apps/dispatch/app/_components/SmartPopup.tsx b/apps/dispatch/app/_components/SmartPopup.tsx index 5923a2fb..3ff5b0dc 100644 --- a/apps/dispatch/app/_components/SmartPopup.tsx +++ b/apps/dispatch/app/_components/SmartPopup.tsx @@ -58,6 +58,7 @@ export const calculateAnchor = ( y: rect.top + rect.height / 2, }; }); + const ownMarkerBounds = (ownMarker as HTMLElement).getBoundingClientRect(); const ownMarkerPosition = { x: ownMarkerBounds.left + ownMarkerBounds.width / 2, @@ -75,6 +76,12 @@ export const calculateAnchor = ( centerOfOverlappingMarkers.x /= markersPosition.length; centerOfOverlappingMarkers.y /= markersPosition.length; + if (id == "2") { + console.log("markersInCluser", marksersInCluster); + console.log("ownMarkerPosition", ownMarkerPosition); + console.log("centerOfOverlappingMarkers", centerOfOverlappingMarkers); + } + if (marksersInCluster.length > 1) { if (centerOfOverlappingMarkers.y < ownMarkerPosition.y) { if (centerOfOverlappingMarkers.x > ownMarkerPosition.x) { diff --git a/apps/dispatch/app/dispatch/_components/map/AircraftMarker.tsx b/apps/dispatch/app/dispatch/_components/map/AircraftMarker.tsx index 496f1f1d..dc462f0f 100644 --- a/apps/dispatch/app/dispatch/_components/map/AircraftMarker.tsx +++ b/apps/dispatch/app/dispatch/_components/map/AircraftMarker.tsx @@ -281,7 +281,6 @@ const AircraftMarker = ({ aircraft }: { aircraft: Aircraft }) => { const handleZoom = () => { const zoom = map.getZoom(); - console.log("zoom", zoom); setHideMarker(zoom < 9); handleConflict(); }; @@ -331,6 +330,8 @@ const AircraftMarker = ({ aircraft }: { aircraft: Aircraft }) => {
{ const map = useMap(); const { contextMenu, setContextMenu, setSearchElements, setSearchPopup } = useMapStore(); - const setMissionFormValues = usePannelStore( - (state) => state.setMissionFormValues, - ); + const { setMissionFormValues, setOpen } = usePannelStore((state) => state); useEffect(() => { const handleContextMenu = (e: any) => { setContextMenu({ lat: e.latlng.lat, lng: e.latlng.lng }); @@ -72,7 +70,7 @@ export const ContextMenu = () => { place_rank: number; type: string; }; - console.log(data); + setOpen(true); setMissionFormValues({ addressLat: contextMenu.lat, addressLng: contextMenu.lng, diff --git a/apps/dispatch/app/dispatch/_components/map/MissionMarkers.tsx b/apps/dispatch/app/dispatch/_components/map/MissionMarkers.tsx index 2519fe97..d5315f70 100644 --- a/apps/dispatch/app/dispatch/_components/map/MissionMarkers.tsx +++ b/apps/dispatch/app/dispatch/_components/map/MissionMarkers.tsx @@ -277,6 +277,8 @@ const MissionMarker = ({ mission }: { mission: Mission }) => { ${mission.missionKeywordAbbreviation} ${mission.missionKeywordName}
{ if (i === existingClusterIndex) { @@ -218,7 +216,6 @@ export const MarkerCluster = () => { map.off("zoomend", handleZoom); }; }, [map, aircrafts, missions]); - console.log("cluster", cluster); return ( <> {cluster.map((c, i) => ( diff --git a/grafana/grafana.db b/grafana/grafana.db index 6f93118e76d3303cd66ea4f1f23d79bc5149686b..302518c8ea897b59a9d4084fad26f42aee89f3ba 100644 GIT binary patch delta 87 zcmZoT;L>owWr8%L;zSu|M#aX2)&$1Z1g6#m=GFw3)&$np1h&=$_N@sVrTVPrGI%tv hwBOR_0Afxc<^p1FAm#yLULfWJV*c&7^aa#D001|iAMXGF delta 87 zcmZoT;L>owWr8##|3n#QM*hZx)&$1Z1g6#m=GFw3)&$np1h&=$_N@sVrTVOUGPrNe hYrmz>0mPg@%mu{UK+FTgyg