Now with states!

merge-requests/203/head test_NewPota1
Tag 2022-09-22 15:47:43 -07:00
rodzic d1ba87803f
commit 956b46d616
1 zmienionych plików z 7 dodań i 6 usunięć

Wyświetl plik

@ -4,6 +4,7 @@
var g_pota = { var g_pota = {
parks: {}, parks: {},
locations: {},
parksTimeout: null, parksTimeout: null,
callSchedule: {}, callSchedule: {},
parkSchedule: {}, parkSchedule: {},
@ -123,21 +124,22 @@ function processPotaParks(buffer)
{ {
try try
{ {
let newParks = JSON.parse(buffer); let data = JSON.parse(buffer);
let newParks = data.parks;
for (const park in newParks) for (const park in newParks)
{ {
let locations = newParks[park].locationDesc.split(","); let locations = newParks[park].locationDesc.split(",");
for (const i in locations) for (const i in locations)
{ {
if (locations[i] in g_StateData) if (locations[i] in data.locations)
{ {
locations[i] = g_StateData[locations[i]].name; locations[i] = data.locations[locations[i]];
} }
} }
newParks[park].locationDesc = locations.join(", "); newParks[park].locationDesc = locations.join(", ");
} }
g_pota.parks = newParks; g_pota.parks = newParks;
g_pota.locations = data.locations;
getPotaSchedule(); getPotaSchedule();
getPotaSpots(); getPotaSpots();
} }
@ -376,8 +378,7 @@ function createParkTipTable(toolElement)
key + key +
" : <font color='cyan'>" + g_pota.parks[key].name + "" + " : <font color='cyan'>" + g_pota.parks[key].name + "" +
" (<font color='yellow'>" + g_dxccToAltName[Number(g_pota.parks[key].entityId)] + "</font>)" + " (<font color='yellow'>" + g_dxccToAltName[Number(g_pota.parks[key].entityId)] + "</font>)" +
// "</br>" + g_pota.parks[key].locationDesc + "</font></br><font color='lightblue'>" + g_pota.parks[key].locationDesc + "</font></div>";
"</font></div>";
if (parkObj.spotted) if (parkObj.spotted)
{ {