Airbases API added

This commit is contained in:
PeekabooSteam
2023-05-29 12:08:21 +01:00
parent e4e9e44eea
commit 64ff5ce539
4 changed files with 150 additions and 43 deletions

View File

@@ -1,6 +1,6 @@
{
"airfields": {
"Anapa": {
"Anapa-Vityazevo": {
"ICAO": "URKA",
"Elevation": "141",
"TACAN": "",
@@ -85,7 +85,7 @@
}
}
},
"KOBULETI": {
"Kobuleti": {
"ICAO": "UG5X",
"Elevation": "69",
"TACAN": "67X",
@@ -102,7 +102,7 @@
}
}
},
"Krasnodar": {
"Krasnodar-Center": {
"ICAO": "URKL",
"Elevation": "98",
"TACAN": "",
@@ -119,7 +119,7 @@
}
}
},
"Krasnodar-P": {
"Krasnodar-Pashkovsky": {
"ICAO": "URKK",
"Elevation": "112",
"TACAN": "",
@@ -153,7 +153,7 @@
}
}
},
"KUTAISI": {
"Kutaisi": {
"ICAO": "UGKO",
"Elevation": "148",
"TACAN": "44X",
@@ -170,7 +170,7 @@
}
}
},
"Maykop": {
"Maykop-Khanskaya": {
"ICAO": "URKH",
"Elevation": "591",
"TACAN": "",
@@ -187,7 +187,7 @@
}
}
},
"MinVody": {
"Mineralnye Vody": {
"ICAO": "URMM",
"Elevation": "1050",
"TACAN": "",
@@ -255,7 +255,7 @@
}
}
},
"Senaki": {
"Senaki-Kolkhi": {
"ICAO": "UGKS",
"Elevation": "43",
"TACAN": "31X",
@@ -272,7 +272,7 @@
}
}
},
"Sochi": {
"Sochi-Adler": {
"ICAO": "URSS",
"Elevation": "98",
"TACAN": "",
@@ -289,7 +289,24 @@
}
}
},
"TbilisiMilitary": {
"Tbilisi-Lochini": {
"ICAO": "UGTB",
"Elevation": "1574",
"TACAN": "25X",
"Runways": {
"13": {
"Mag Hdg": "121",
"Length": "9300",
"ILS": "110.30"
},
"31": {
"Mag Hdg": "301",
"Length": "9300",
"ILS": "108.90"
}
}
},
"Soganlug": {
"ICAO": "UG24",
"Elevation": "1500",
"TACAN": "25X",
@@ -306,7 +323,7 @@
}
}
},
"Sukhumi": {
"Sukhumi-Babushara": {
"ICAO": "UGSS",
"Elevation": "43",
"TACAN": "",
@@ -323,23 +340,6 @@
}
}
},
"Lochini": {
"ICAO": "UGTB",
"Elevation": "1574",
"TACAN": "25X",
"Runways": {
"13": {
"Mag Hdg": "121",
"Length": "9300",
"ILS": "110.30"
},
"31": {
"Mag Hdg": "301",
"Length": "9300",
"ILS": "108.90"
}
}
},
"Vaziani": {
"ICAO": "UG27",
"Elevation": "1524",

View File

@@ -9,6 +9,8 @@ export class MissionHandler
#airbases : {[name: string]: Airbase} = {};
#theatre : string = "";
#airbaseData : { [name: string]: object } = {};
constructor()
{
@@ -32,8 +34,29 @@ export class MissionHandler
}
}
if ("mission" in data)
{
if (data.mission != null && data.mission.theatre != this.#theatre)
{
this.#theatre = data.mission.theatre;
getMap().setTheatre(this.#theatre);
getInfoPopup().setText("Map set to " + this.#theatre);
}
}
if ("airbases" in data)
{
/*
console.log( Object.values( data.airbases ).sort( ( a:any, b:any ) => {
const aVal = a.callsign.toLowerCase();
const bVal = b.callsign.toLowerCase();
return aVal > bVal ? 1 : -1;
}) );
//*/
for (let idx in data.airbases)
{
var airbase = data.airbases[idx]
@@ -54,17 +77,6 @@ export class MissionHandler
//this.#airbases[idx].setParkings(["2x big", "5x small"]);
}
}
if ("mission" in data)
{
if (data.mission != null && data.mission.theatre != this.#theatre)
{
this.#theatre = data.mission.theatre;
getMap().setTheatre(this.#theatre);
getInfoPopup().setText("Map set to " + this.#theatre);
}
}
}
getBullseyes()