From f94ec5e9555a5c4ce280a8ec63930783eeda5088 Mon Sep 17 00:00:00 2001 From: Felix Date: Sun, 3 Nov 2024 22:15:07 +0100 Subject: [PATCH 1/2] Fixed tracon circles --- src/components/map/airports/MapAirport.vue | 45 ++++++++++++++++++---- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/src/components/map/airports/MapAirport.vue b/src/components/map/airports/MapAirport.vue index 549e3ff6..aea82679 100644 --- a/src/components/map/airports/MapAirport.vue +++ b/src/components/map/airports/MapAirport.vue @@ -422,17 +422,49 @@ onMounted(async () => { const features: ArrFeature[] = []; if (!props.features.length && 'lon' in props.airport && !isPseudoAirport.value) { + const borderFeature = new Feature({ + geometry: fromCircle(new Circle([props.airport.lon, props.airport.lat], 80000), undefined, toRadians(-90)), + icao: props.airport.icao, + iata: props.airport.iata, + id: 'circle', + type: 'circle', + }); + + setBorderFeatureStyle(borderFeature); + features.push({ id: 'circle', - feature: new Feature({ - geometry: fromCircle(new Circle([props.airport.lon, props.airport.lat], 80000), undefined, toRadians(-90)), + feature: borderFeature, + controllers: props.arrAtc, + }); + + + if (!store.mapSettings.visibility?.atcLabels) { + const feature = borderFeature; + const geometry = feature.getGeometry(); + const extent = feature.getGeometry()?.getExtent(); + const topCoord = [extent![0], extent![3]]; + let textCoord = geometry?.getClosestPoint(topCoord) || topCoord; + if (feature.getProperties().label_lat) { + textCoord = fromLonLat([feature.getProperties().label_lon, feature.getProperties().label_lat]); + } + + const labelFeature = new Feature({ + geometry: new Point(textCoord), + type: 'tracon-label', icao: props.airport.icao, iata: props.airport.iata, id: 'circle', - type: 'circle', - }), - controllers: props.arrAtc, - }); + }); + + setLabelFeatureStyle(labelFeature); + + features.push({ + id: 'circle', + feature: labelFeature, + controllers: props.arrAtc, + }); + } } else { const leftAtc = props.arrAtc.filter(x => !props.features.some(y => y.controllers.some(y => y.cid === x.cid))); @@ -490,7 +522,6 @@ onMounted(async () => { features.push({ id, feature: labelFeature, - traconFeature, controllers: [ ...controllers, ...leftAtc, From e4ec07c07c67593a2f8a9e9df116f143f64299ea Mon Sep 17 00:00:00 2001 From: Felix Date: Mon, 4 Nov 2024 14:30:48 +0100 Subject: [PATCH 2/2] Readded traconFeature --- src/components/map/airports/MapAirport.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/map/airports/MapAirport.vue b/src/components/map/airports/MapAirport.vue index aea82679..3d14f814 100644 --- a/src/components/map/airports/MapAirport.vue +++ b/src/components/map/airports/MapAirport.vue @@ -522,6 +522,7 @@ onMounted(async () => { features.push({ id, feature: labelFeature, + traconFeature, controllers: [ ...controllers, ...leftAtc,