Commit 5eea0b7c authored by Nina Willems's avatar Nina Willems

[client/timeserie] choice ground or surface

parent d4546c61
......@@ -19,6 +19,29 @@ export const addStationLayer = (
addLayer(waterMapId, () => some(layerInfo(kind)), fetchData(kind));
};
export const loadGroundLayers = () => {
fetchLayerGroundQuality()
.then((fc) => {
assign('data/layer/ground/quality', fc);
addStationLayer('ground-quality');
})
.catch(err => logger(`ERROR loading ground quality layer: ${err}`));
fetchLayerGroundQuantity()
.then((fc) => {
assign('data/layer/ground/quantity', fc);
addStationLayer('ground-quantity');
})
.catch(err => logger(`ERROR loading ground quantity layer: ${err}`));
}
export const loadSurfaceLayers = () => {
fetchLayerSurface()
.then((fc) => {
assign('data/layer/surface', fc);
addStationLayer('surface');
})
.catch(err => logger(`ERROR loading surface layer: ${err}`));
}
export const loadLayers = () => {
fetchLayerSurface()
......
......@@ -10,7 +10,7 @@ import { getSelectedKind, getSelectedParameterList, getWindowStart, getWindowEnd
import { ParameterType } from '../types';
import { getLayout } from '../queries/app';
import { FeaturePath } from 'sdi/map';
import { loadLayers } from './map';
import { loadGroundLayers, loadSurfaceLayers } from './map';
......@@ -241,7 +241,12 @@ export const loadRoute =
export const navigateIndex = (
level: Level,
) => {
loadLayers();
if (level === 'surface') {
loadSurfaceLayers();
}
else if (level === 'ground') {
loadGroundLayers();
}
navigate('index', [level]);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment