From 76a1f174e6a9d6f2999a28bee6563df4d68163f6 Mon Sep 17 00:00:00 2001 From: Tor-Einar Skog <tor-einar.skog@nibio.no> Date: Tue, 15 Aug 2023 11:03:42 +0200 Subject: [PATCH] Add method for fetching all weather data sources from IPMD --- ipmd/static/ipmd/js/ipmdlib.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ipmd/static/ipmd/js/ipmdlib.js b/ipmd/static/ipmd/js/ipmdlib.js index 71a91f5a..052fcdad 100644 --- a/ipmd/static/ipmd/js/ipmdlib.js +++ b/ipmd/static/ipmd/js/ipmdlib.js @@ -46,6 +46,12 @@ async function getWeatherDatasource(weatherDatasourceId) return await response.json(); } +async function getWeatherDatasources() +{ + const response = await fetch(ipmdWeatherApiURL + "rest/weatherdatasource/"); + return await response.json(); +} + function getWeatherStationList(weatherDatasource){ geoJson = JSON.parse(weatherDatasource.spatial.geoJSON); let stationList = []; -- GitLab