Merge pull request #115 from Pax1601/79-automatic-theater-selection-only-works-for-syria

Added data for other theaters
This commit is contained in:
Pax1601 2023-03-21 14:39:47 +01:00 committed by GitHub
commit 7a2d7ce526
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -590,7 +590,7 @@ class DemoDataGenerator {
};
mission(req, res){
var ret = {theatre: "NTTR"};
var ret = {mission: {theatre: "Nevada"}};
res.send(JSON.stringify(ret));
}

View File

@ -43,12 +43,21 @@ export class MissionHandler
if ("mission" in data)
{
var foo = 1;
if (data.mission.theatre != this.#theatre)
{
this.#theatre = data.mission.theatre
if (this.#theatre == "Syria")
getMap().setView(new LatLng(34.5, 36.0), 8);
else if (this.#theatre == "MarianaIslands")
getMap().setView(new LatLng(16.7, 145.7), 7);
else if (this.#theatre == "Nevada")
getMap().setView(new LatLng(37.1, -115.2), 8);
else if (this.#theatre == "PersianGulf")
getMap().setView(new LatLng(26.5, 55.3), 8);
else if (this.#theatre == "Falklands")
getMap().setView(new LatLng(-50.6, -42.7), 7);
else if (this.#theatre == "Caucasus")
getMap().setView(new LatLng(42.1, 42.3), 8);
}
}
}