diff --git a/CHANGELOG.md b/CHANGELOG.md index db9abca6..7441d5d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +# [1.0.0-alpha.2] + +- Updated taxiways colors +- You can now disable Navigraph Layers, as well as disable new gates system, taxiways, runway exits, gate guidance, deicing pads + # [1.0.0-alpha.1.1] - Fixed some gates missing diff --git a/package.json b/package.json index f83fd50c..93a1b297 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vatsim-radar", - "version": "1.0.0-alpha.1.1", + "version": "1.0.0-alpha.2", "private": true, "type": "module", "scripts": { diff --git a/src/components/map/airports/MapAirport.vue b/src/components/map/airports/MapAirport.vue index 47d8fd80..cf0692b9 100644 --- a/src/components/map/airports/MapAirport.vue +++ b/src/components/map/airports/MapAirport.vue @@ -634,46 +634,54 @@ onMounted(async () => { immediate: true, }); - const supportedLayouts: NavigraphLayoutType[] = [ - 'parkingstandarea', - 'apronelement', - 'arrestinggearlocation', - 'blastpad', - 'constructionarea', - 'deicingarea', - 'finalapproachandtakeoffarea', - 'taxiwayintersectionmarking', - 'runwaythreshold', - 'runwaydisplacedarea', - 'runwayelement', - 'runwayexitline', - 'runwayintersection', - 'runwaymarking', - 'runwayshoulder', - 'frequencyarea', - 'serviceroad', - 'standguidanceline', - 'taxiwayelement', - 'taxiwayholdingposition', - 'taxiwayshoulder', - 'verticallinestructure', - 'verticalpolygonalstructure', - 'taxiwayguidanceline', - ]; + const supportedLayouts = computed(() => { + const supported: NavigraphLayoutType[] = [ + 'parkingstandarea', + 'apronelement', + 'arrestinggearlocation', + 'blastpad', + 'constructionarea', + 'finalapproachandtakeoffarea', + 'runwaythreshold', + 'runwaydisplacedarea', + 'runwayelement', + 'runwayintersection', + 'runwaymarking', + 'runwayshoulder', + 'frequencyarea', + 'serviceroad', + 'taxiwayshoulder', + 'verticallinestructure', + 'verticalpolygonalstructure', + ]; + + const disabledTaxiways = store.mapSettings.navigraphLayers?.hideTaxiways; + const disabledGates = store.mapSettings.navigraphLayers?.hideGateGuidance; + const disabledRunways = store.mapSettings.navigraphLayers?.hideRunwayExit; + const disabledDeicing = store.mapSettings.navigraphLayers?.hideDeicing; + + if (!disabledTaxiways) supported.push('taxiwayelement', 'taxiwayholdingposition', 'taxiwayguidanceline', 'taxiwayintersectionmarking'); + if (!disabledGates) supported.push('standguidanceline'); + if (!disabledRunways) supported.push('runwayexitline'); + if (!disabledDeicing) supported.push('deicingarea'); + + return supported; + }); + + watch([layout, supportedLayouts], ([val]) => { + layoutFeatures.forEach(feature => { + layerSource.value?.removeFeature(feature); + feature.dispose(); + }); + layoutFeatures = []; - watch(layout, val => { if (!val) { - layoutFeatures.forEach(feature => { - layerSource.value?.removeFeature(feature); - feature.dispose(); - }); - layoutFeatures = []; return; } for (const [_key, value] of Object.entries(val)) { const key = _key as NavigraphLayoutType; - if (!supportedLayouts.includes(key)) continue; + if (!supportedLayouts.value.includes(key)) continue; const features = geojson.readFeatures(value, { dataProjection: 'EPSG:4326', diff --git a/src/components/map/airports/MapAirportsList.vue b/src/components/map/airports/MapAirportsList.vue index 21732354..bfa6ad91 100644 --- a/src/components/map/airports/MapAirportsList.vue +++ b/src/components/map/airports/MapAirportsList.vue @@ -194,6 +194,13 @@ function handleMapClick(e: MapBrowserEvent) { if (isMobileOrTablet.value) handlePointerMove(e); } +watch(() => String(store.mapSettings.navigraphLayers?.disable) + String(store.mapSettings.navigraphLayers?.gatesFallback), () => { + originalAirportsData.value = []; + airportsData.value = []; + + setVisibleAirports(); +}); + watch(map, val => { if (!val || vectorLayer) return; @@ -646,7 +653,12 @@ async function setVisibleAirports() { if (!navigraphAirports.every(x => originalAirportsData.value.some(y => y.airport === x.vatsimAirport.icao))) { originalAirportsData.value = [ ...originalAirportsData.value, - ...(await Promise.all(navigraphAirports.filter(x => !originalAirportsData.value.some(y => y.airport === x.vatsimAirport.icao)).map(x => $fetch(`/api/data/navigraph/airport/${ x.vatsimAirport.icao }?v=${ store.version }&isLayout=${ (store.user?.hasCharts && store.user?.hasFms) ? '1' : '0' }`)))).flatMap(x => x ?? []), + ...(await Promise.all( + navigraphAirports.filter(x => !originalAirportsData + .value + .some(y => y.airport === x.vatsimAirport.icao)) + .map(x => $fetch(`/api/data/navigraph/airport/${ x.vatsimAirport.icao }?v=${ store.version }&layout=${ (store.user?.hasCharts && store.user?.hasFms && !store.mapSettings.navigraphLayers?.disable) ? '1' : '0' }&originalData=${ store.mapSettings.navigraphLayers?.gatesFallback ? '1' : '0' }`)), + )).flatMap(x => x ?? []), ]; } diff --git a/src/components/map/filters/settings/MapSettingsVisibility.vue b/src/components/map/filters/settings/MapSettingsVisibility.vue index 55b6333a..a3fabcc2 100644 --- a/src/components/map/filters/settings/MapSettingsVisibility.vue +++ b/src/components/map/filters/settings/MapSettingsVisibility.vue @@ -202,6 +202,63 @@ + + Personal Info diff --git a/src/composables/airport-layout.ts b/src/composables/airport-layout.ts index 14d89bb2..3aff69ac 100644 --- a/src/composables/airport-layout.ts +++ b/src/composables/airport-layout.ts @@ -8,7 +8,7 @@ import type { Options as StyleOptions } from 'ol/style/Style'; const taxiwayNameRegex = new RegExp('^((Main TWY)|Main|Route) ', 'i'); -export const airportLayoutStyles = (): PartialRecord Style | undefined)> => { +export const airportLayoutStyles = (): PartialRecord Style | Style[] | undefined)> => { const theme = useStore().getCurrentTheme; const themeStyles = { @@ -17,12 +17,12 @@ export const airportLayoutStyles = (): PartialRecord { const options: StyleOptions = { stroke: new Stroke({ - color: `rgba(${ getCurrentThemeRgbColor('warning700').join(',') }, 1)`, + color: `rgba(${ getCurrentThemeRgbColor('warning700').join(',') }, 0.8)`, }), + zIndex: 4, }; if (feature.getProperties().idlin) { @@ -258,7 +262,7 @@ export const airportLayoutStyles = (): PartialRecord = ['total', 'prefiles', 'ground', 'groundMoving', 'hide']; const turnsKeys: Array = ['magma', 'inferno', 'rainbow', 'viridis']; const tracksKeys: Array = ['arrivalsOnly', 'arrivalsAndLanded', 'departures', 'ground', 'allAirborne', 'all']; +const navigraphKeys: Array = ['disable', 'gatesFallback', 'hideTaxiways', 'hideGateGuidance', 'hideRunwayExit', 'hideDeicing']; const colors = Object.keys(colorsList); @@ -135,6 +136,15 @@ const validators: Record boolean> = { return true; }, + navigraphLayers: val => { + if (!isObject(val)) return false; + + if (!validateRandomObjectKeys(val, navigraphKeys)) return false; + + if (!Object.values(val).every(x => typeof x === 'boolean')) return false; + + return true; + }, aircraftScale: val => { return typeof val === 'number' && val > 0 && val < 5; }, @@ -234,6 +244,14 @@ export interface IUserMapSettings { excludeMyArrival?: boolean; excludeMyLocation?: boolean; }; + navigraphLayers: Partial<{ + disable: boolean; + gatesFallback?: boolean; + hideTaxiways?: boolean; + hideGateGuidance?: boolean; + hideRunwayExit?: boolean; + hideDeicing?: boolean; + }>; aircraftScale: number; airportsMode: 'staffedOnly' | 'staffedAndGroundTraffic' | 'all'; tracks: {