Skip to content
Snippets Groups Projects
Commit 4c29b782 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Show today or alternatively last date in series

parent 39fd888d
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@ let layers = [];
//let mapserverURL="https://testvips.nibio.no/cgi-bin/";
let mapserverURL="https://gridweb.vips.nibio.no/cgi-bin/";
let modelId = undefined;
let today = "2023-04-10";
let today = getSystemTime().format("YYYY-MM-DD");
let todayLayerIndex = undefined;
let timestamps = undefined;
let currentParameter = "WARNING_STATUS";
......@@ -186,6 +186,12 @@ msLoadMap(): Unable to access file. (/disks/data01/mapserver/wms/SEPTREFFUM/SEPT
});
map.setView(view);
// If today is outside of the date range, use the most recent timestamp
if(todayLayerIndex == undefined)
{
todayLayerIndex = timestamps.length -1;
}
let range = document.getElementById("layerDateRange");
range.min = 0;
range.max = timestamps.length -1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment