From 59116b4d376dde750fffd2e7c49a37b3da0026d9 Mon Sep 17 00:00:00 2001 From: Gaudv Date: Sat, 2 Nov 2024 20:39:23 +0100 Subject: [PATCH 1/5] differentiates planes on map --- public/meta/aircraft-icon-a32nx.png | Bin 0 -> 840 bytes public/meta/aircraft-icon-a380x.png | Bin 0 -> 897 bytes public/meta/aircraft-icon.png | Bin 594 -> 645 bytes src/components/Map/Map.tsx | 33 ++++++++++++++++++++++++---- 4 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 public/meta/aircraft-icon-a32nx.png create mode 100644 public/meta/aircraft-icon-a380x.png diff --git a/public/meta/aircraft-icon-a32nx.png b/public/meta/aircraft-icon-a32nx.png new file mode 100644 index 0000000000000000000000000000000000000000..3df5c9247ebeb21680258460b4628662ed7c3b8b GIT binary patch literal 840 zcmV-O1GoH%P)tfsMTILDRvT><5>!_(!U`FU5*I=Y+HNdFybHykON4n_%p2If*K=mh z%xSoAzAzk^_xbmmnfHC4nKQGrv}7$a=(~WnOa=7K>?DGQnB9ZD*pW_si?_=n|E23( zGhI*ORQzddS~heU50pjzTbKDJ@d)j;vUs=yA9kH=5(0J%8GEAZWRnnZ+mNx1T_;=f ztI$+H-%JJc%~U|&ta$-rHFF_m168|lJ1&<+ere1&n^Y~v6#~v)=6+D7d_y`x87SgyIO;>+A4q!9R<1k)QiKxS3^52QOv5@?a zHoXhu+<^gZNyiNC!tRDK)+e8!xzwiwX;p?)<7wY<# zMLu(#?PffQ=T#pAZXT8RdViX&;aBigD*C&!$p2{Id!u3&a1aMW%r@Y0m6)egebz`u z2{@0>RYm_e&PG$0bV24ZA7VC(hgD*pRka(dvYLRi_!3{>Oa=7KR6yT!whD!qt;2hGZG`Ek*xkiONJj!f%;xYJ?yu=` z7B7@V{&U;htskM(V4YIGc&azBpF+%bwawqf95{dtWBA>wde>;hB>ttmplSn-rsGd+ zQ+Eo3Z-%tdV?q83s}w1|wX z7A>kxLKNgGY89=DAVR23ZPHz6AC`*hIv5@<=nD@r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g%2^H7z|c|f)Z@B2?~N(_!CU0t#-C4 zZ7ppr(@Dx8SmXz!31s))35kUS1c`#$h!VvJLT--Cthh1D^4{AW-^|K>`{N)3^Abg z71^W1#Qz@Iqs2gCN(E9=Dv+8|fz(WF1su;qZMo8b*eV<^Asfgk2p@(%r%HU^#6Fad zu)-5*#dmlOVx8K;2b;SsC~vke-0?KTos`m+^JVkdyGxq zs20S_5H3P&9b$(KLw>*7Ks~_+Jpo?Gv7bt+)*fY>=Yl97T(O_Eu065=A1r?%f59!D z9eD$WvCWxKeSgx4?Zq)5_Nn)UT)=CdY^|AF<1`#^Lx1ck)ZRB+FSZi`?0732p-qWl z;3!^$*WxvKZU3Cu23n^WNKL6gY9_VUS_Od}=vjfL@WI?Z& z`CeOmzY;&fdq#2^3(qYRI&gb@4F84s-Sw^WCNIG8Ug+u7-ehRNb|Ll*jt{WGxyt!| mj-Tt-s2%OLqOnl;kNE{ { - const aircraftStyle = `transform: rotate(${heading}deg); transform-origin: center; width: 32px; height: 32px; filter: drop-shadow(0 0 2px rgba(0 0 0 /0.5))`; +const AircraftIcon = (heading: number, aircraftId: string, aircraftType: string) => { + var aircraftIconUrl = "/meta/aircraft-icon.png"; + var aircraftIconSize = 28 + if (aircraftType.includes("A32")) { aircraftIconUrl = "/meta/aircraft-icon-a32nx.png"; } + if (aircraftType.includes("A38")) { aircraftIconUrl = "/meta/aircraft-icon-a380x.png"; aircraftIconSize = 38; } + const aircraftIconStyle = `transform: rotate(${heading}deg); transform-origin: center; width: ${aircraftIconSize}px; height: ${aircraftIconSize}px; filter: drop-shadow(0 0 2px rgba(0 0 0 /0.5))`; return new DivIcon({ iconSize: [0, 0], iconAnchor: [15, 10], - html: `${aircraftId}`, + html: `${aircraftId}`, }); }; @@ -25,6 +29,26 @@ export interface LeafletMapProps { const LeafletMap: FC = ({ isFullPageMap, className }) => { const [flights, setFlights] = useState([]); + const MapLegend = () => { + return( +
+
+
+ +

FlyByWire A32NX

+
+ +

FlyByWire A380X

+
+ +

Others

+
+
+
+
+ ) + } + useEffect(() => { Telex.fetchAllConnections().then((flights) => setFlights(flights)); }, []); @@ -40,7 +64,7 @@ const LeafletMap: FC = ({ isFullPageMap, className }) => { /> {flights.map((it) => ( - +
@@ -74,6 +98,7 @@ const LeafletMap: FC = ({ isFullPageMap, className }) => { ))} +
); From ee6095168712f450e6ca7e4b5de2e4c22a29904f Mon Sep 17 00:00:00 2001 From: Gaudv Date: Sat, 2 Nov 2024 20:47:28 +0100 Subject: [PATCH 2/5] comptess inline css (lint rules) --- src/components/Map/Map.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Map/Map.tsx b/src/components/Map/Map.tsx index d0b8b4c1..d959aa22 100644 --- a/src/components/Map/Map.tsx +++ b/src/components/Map/Map.tsx @@ -9,7 +9,7 @@ const AircraftIcon = (heading: number, aircraftId: string, aircraftType: string) var aircraftIconSize = 28 if (aircraftType.includes("A32")) { aircraftIconUrl = "/meta/aircraft-icon-a32nx.png"; } if (aircraftType.includes("A38")) { aircraftIconUrl = "/meta/aircraft-icon-a380x.png"; aircraftIconSize = 38; } - const aircraftIconStyle = `transform: rotate(${heading}deg); transform-origin: center; width: ${aircraftIconSize}px; height: ${aircraftIconSize}px; filter: drop-shadow(0 0 2px rgba(0 0 0 /0.5))`; + const aircraftIconStyle = `transform:rotate(${heading}deg);transform-origin:center;width:${aircraftIconSize}px;height:${aircraftIconSize}px;filter:drop-shadow(0 0 2px rgba(0 0 0 /0.5))`; return new DivIcon({ iconSize: [0, 0], From 4da6771bff5cb81a180e2bc7113a2c6eace3a72e Mon Sep 17 00:00:00 2001 From: Gaudv Date: Sat, 2 Nov 2024 21:08:49 +0100 Subject: [PATCH 3/5] global lint fix on map composent --- src/components/Map/Map.tsx | 47 +++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/src/components/Map/Map.tsx b/src/components/Map/Map.tsx index d959aa22..82bd8a17 100644 --- a/src/components/Map/Map.tsx +++ b/src/components/Map/Map.tsx @@ -5,10 +5,14 @@ import { DivIcon } from 'leaflet'; import { ArrowRightOutlined } from '@ant-design/icons'; const AircraftIcon = (heading: number, aircraftId: string, aircraftType: string) => { - var aircraftIconUrl = "/meta/aircraft-icon.png"; - var aircraftIconSize = 28 - if (aircraftType.includes("A32")) { aircraftIconUrl = "/meta/aircraft-icon-a32nx.png"; } - if (aircraftType.includes("A38")) { aircraftIconUrl = "/meta/aircraft-icon-a380x.png"; aircraftIconSize = 38; } + let aircraftIconUrl = '/meta/aircraft-icon.png'; + let aircraftIconSize = 28; + if (aircraftType.includes('A32')) { + aircraftIconUrl = '/meta/aircraft-icon-a32nx.png'; + } + if (aircraftType.includes('A38')) { + aircraftIconUrl = '/meta/aircraft-icon-a380x.png'; aircraftIconSize = 38; + } const aircraftIconStyle = `transform:rotate(${heading}deg);transform-origin:center;width:${aircraftIconSize}px;height:${aircraftIconSize}px;filter:drop-shadow(0 0 2px rgba(0 0 0 /0.5))`; return new DivIcon({ @@ -29,25 +33,26 @@ export interface LeafletMapProps { const LeafletMap: FC = ({ isFullPageMap, className }) => { const [flights, setFlights] = useState([]); - const MapLegend = () => { - return( -
+ const MapLegend = () => ( +
-
- -

FlyByWire A32NX

-
- -

FlyByWire A380X

-
- -

Others

-
-
+
+ + +

FlyByWire A32NX

+
+ + +

FlyByWire A380X

+
+ + +

Others

+
+
-
- ) - } +
+ ); useEffect(() => { Telex.fetchAllConnections().then((flights) => setFlights(flights)); From ed3c7b51cfe8f1caec892c1697509c3de88855b8 Mon Sep 17 00:00:00 2001 From: Gaudv Date: Sat, 2 Nov 2024 23:49:15 +0100 Subject: [PATCH 4/5] MapLegend responsive --- src/components/Map/Map.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/Map/Map.tsx b/src/components/Map/Map.tsx index 82bd8a17..b367eea4 100644 --- a/src/components/Map/Map.tsx +++ b/src/components/Map/Map.tsx @@ -34,18 +34,18 @@ const LeafletMap: FC = ({ isFullPageMap, className }) => { const [flights, setFlights] = useState([]); const MapLegend = () => ( -
+
- + -

FlyByWire A32NX

+

FlyByWire A32NX

- + -

FlyByWire A380X

+

FlyByWire A380X

- +

Others

From 288bbac95a6c60dae409bfbce70db5f56bc85144 Mon Sep 17 00:00:00 2001 From: Gaudv Date: Sat, 2 Nov 2024 23:53:49 +0100 Subject: [PATCH 5/5] lint fix --- src/components/Map/Map.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/Map/Map.tsx b/src/components/Map/Map.tsx index b367eea4..887d2426 100644 --- a/src/components/Map/Map.tsx +++ b/src/components/Map/Map.tsx @@ -39,11 +39,17 @@ const LeafletMap: FC = ({ isFullPageMap, className }) => {
-

FlyByWire A32NX

+

+ FlyByWire + A32NX +

-

FlyByWire A380X

+

+ FlyByWire + A380X +