Skip to content

Commit

Permalink
map fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zachbf committed Mar 19, 2022
1 parent d9aa164 commit 5ab6e7d
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 3 deletions.
3 changes: 3 additions & 0 deletions atc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
16 changes: 16 additions & 0 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
16 changes: 16 additions & 0 deletions config/production.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
4 changes: 2 additions & 2 deletions iso2dec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
40 changes: 39 additions & 1 deletion public/sectormap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")){
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand Down

0 comments on commit 5ab6e7d

Please sign in to comment.