-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
Hi, So I will add this in CHANGELOG.md? [1.3.1] - 2021-12-29Deprecated
or something like that? |
in the unreleased part for now, as we don't make new release just for this feature and with more specification, so the reader can understand what and where exactly should be changed |
I fixed this in release notes. |
@@ -124,6 +124,10 @@ const TimeSeriesSlider = ({ availableDates, modifiedLayer }) => { | |||
|
|||
const [currentValue, setCurrentValue] = useState(undefined); | |||
|
|||
useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you have more layers in map visible with slider and deselect one of these layers, slider stay on the date you selected before on this layer. So I added this useEffect to always show LAST value. You can comment out this and check the behavior or if we should do it another way. In PublicMap.js we have code on LN142-144, if I comment this out, slider behave the same. What was the purpose of it? I suppose this should fetch the LAST values for the layer, but we have LAST values also without it, when you show the slider for the first time when we use it on LN214. (Thats because of LN132-134 in TimeSeriesSlider.js.) And when we use it on LN171 in PublicMap.js, this doesn't set slider to LAST, because currentValue already exist. So my question is should I remove PublicMap.js LN142-144? And leave this code in TimeSeriesSlider? Thanks for checking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, so this is ok?
…openkfw/Oscar into 89-show-multiple-regions-layers
setTimeSeriesSlider(false); | ||
setModifiedLayer(null); | ||
} | ||
} else { | ||
// layer is not selected, selecting | ||
// deselect the rest of regions layers, if regions layer selected | ||
// deselect the rest of regions layers, if regions layer with singleDisplay true is selected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this comment should be to if on L182
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I moved it.
} | ||
}); | ||
} else { | ||
// deselect regions layer, which have singleDisplay true, if regions layer with singleDisplay false is selected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'regions layer, which has'
it's only one ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah you are right :) fixed
@@ -7,8 +7,17 @@ const groupLayer = (layerData, handleIsLoading) => { | |||
title: layerData.title, | |||
type: layerData.layerType, | |||
legend: layerData.legend, | |||
layers: layerData.layers.map((layer) => staticLayerGenerator({ ...layer, visible: true }, handleIsLoading)), | |||
timeseries: layerData.timeseries, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be still compatible with this data structure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed this and tested it. Please check it. I removed 'timeseries' key from documentation (moved it to layerOptions). Should I also leave the documentation as it was before + add layerOptions description?
@@ -6,6 +6,11 @@ const logger = require('../config/winston'); | |||
const { getOneLayerGeoData, saveMapLayers } = require('./db'); | |||
|
|||
const addMapLayer = async (data) => { | |||
if (data.timeseries !== undefined) { | |||
logger.info( | |||
`DeprecationWarning: 'timeseries' key on the top level is deprecated. Move 'timeseries' key in 'layerOptions' key in ${data.referenceId} layer in mapLayers config.`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Description
Show multiple region layers. Create layerOptions in mapLayers config.
How has this been tested?
TEST singleLayer: true with 2 timeseries layers behavior:
Daily_Covid19_cases1.csv
Daily_Covid19_cases2.csv
Daily_Covid19_cases3.csv
Leave singleDisplay false for both timeseries layers to check functionality with more sliders shown on the map. Change singleDisplay to true in other layers for checking singleDisplay functionality. Add maxResolution: 1000 to any of the layers to check if it works.
Run ./start.sh, ./runinitialload.sh with COUNTRY=Sample. Check layers on the map.
Now you have 2 timeseries layers for testing purposes, one in Baseline data and one in Covid-19. You can add one more for testing purposes.
Screenshots (if appropriate):
Types of changes
Checklist: