From 5ab6e7d3d2553546300b53acc31861369ecc5a6b Mon Sep 17 00:00:00 2001 From: zach <7121192+zachbf@users.noreply.github.com> Date: Sat, 19 Mar 2022 15:32:40 +1100 Subject: [PATCH] map fixes --- atc.js | 3 +++ config/default.json | 16 ++++++++++++++++ config/production.json | 16 ++++++++++++++++ iso2dec.js | 4 ++-- public/sectormap.js | 40 +++++++++++++++++++++++++++++++++++++++- 5 files changed, 76 insertions(+), 3 deletions(-) diff --git a/atc.js b/atc.js index 1d66a54..9e66df7 100644 --- a/atc.js +++ b/atc.js @@ -89,6 +89,9 @@ export async function getATCSectors() { if (config.get("map.sectors.standard").includes(sector.Callsign)){ sector.standard_position = true; } + if (config.get("map.sectors.border").includes(sector.Callsign)){ + sector.border_position = true; + } sectors.push(sector); }); return sectors; diff --git a/config/default.json b/config/default.json index 2c3d815..9dc3486 100644 --- a/config/default.json +++ b/config/default.json @@ -40,6 +40,22 @@ "NWWW_CTR", "AYPM_CTR", "NVVV_CTR" + ], + "border": [ + "NZZO_FSS", + "ZAK_E_FSS", + "ZAK_W_FSS", + "FAKO_FSS", + "WAAF_CTR", + "WAAF_B_CTR", + "WIIF_E_CTR", + "WIIF_W_CTR", + "VCCF_CTR", + "VRMF_CTR", + "FIMM_CTR", + "FAJO_FSS", + "NZCM_FSS", + "NSFA_FSS" ] }, "majorAerodromes": [ diff --git a/config/production.json b/config/production.json index 2c3d815..9dc3486 100644 --- a/config/production.json +++ b/config/production.json @@ -40,6 +40,22 @@ "NWWW_CTR", "AYPM_CTR", "NVVV_CTR" + ], + "border": [ + "NZZO_FSS", + "ZAK_E_FSS", + "ZAK_W_FSS", + "FAKO_FSS", + "WAAF_CTR", + "WAAF_B_CTR", + "WIIF_E_CTR", + "WIIF_W_CTR", + "VCCF_CTR", + "VRMF_CTR", + "FIMM_CTR", + "FAJO_FSS", + "NZCM_FSS", + "NSFA_FSS" ] }, "majorAerodromes": [ diff --git a/iso2dec.js b/iso2dec.js index de181df..49cce2d 100644 --- a/iso2dec.js +++ b/iso2dec.js @@ -35,11 +35,11 @@ function idl(latitude,longitude){ // If it is less than 180, add 360 to the second point. if(longitude > 179 || longitude < -179){ - console.log({latitude: latitude, longitude: longitude}) + //console.log({latitude: latitude, longitude: longitude}) } // Since we don't know about lines, only points we clobber all points to suit Australia. - if(longitude < -170){ + if(longitude < -100){ longitude = longitude + 360; console.log(longitude); } diff --git a/public/sectormap.js b/public/sectormap.js index 35969e0..2b457c1 100644 --- a/public/sectormap.js +++ b/public/sectormap.js @@ -122,6 +122,17 @@ async function getATCSectors() { }); + var borderSectors = []; + sectorsJson.forEach(sector => { + if(sector.border_position === true){ + var sector = mergeBoundaries(sector); + if(sector != false){ + borderSectors.push(sector); + } + } + + }); + var upperSectors = []; sectorsJson.forEach(sector => { if(sector.Callsign.includes("FSS") ||sector.Callsign.includes("CTR")){ @@ -161,6 +172,11 @@ async function getATCSectors() { 'data': turf.featureCollection(stdSectors) }); + map.addSource('border', { + 'type': 'geojson', + 'data': turf.featureCollection(borderSectors) + }); + map.addSource('upper', { 'type': 'geojson', 'data': turf.featureCollection(upperSectors) @@ -292,6 +308,18 @@ async function getATCSectors() { } }); + map.addLayer({ + 'id': 'borderLine', + 'type': 'line', + 'source': 'border', + 'layout': {}, + //'minzoom': 5, + 'paint': { + 'line-color': "#949494", + 'line-width': 4 + } + }); + map.addLayer({ 'id': 'stdLine', 'type': 'line', @@ -313,7 +341,17 @@ async function getATCSectors() { 'paint': { 'text-color': "#000", } - }); + }); + + map.addLayer({ + 'id': 'borderText', + 'type': 'symbol', + 'source': 'border', // reference the data source + 'layout': stdLayout, + 'paint': { + 'text-color': "#646464", + } + }); map.addLayer({ 'id': 'upperText',