Skip to content

Commit

Permalink
Merge pull request #466 from FX5F/fixTraconCircles
Browse files Browse the repository at this point in the history
Fixed tracon circles
  • Loading branch information
daniluk4000 authored Nov 4, 2024
2 parents 36d9f94 + a95ee9f commit a964f14
Showing 1 changed file with 38 additions and 6 deletions.
44 changes: 38 additions & 6 deletions src/components/map/airports/MapAirport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down

0 comments on commit a964f14

Please sign in to comment.