Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

WV-4038 - Land/Water Map Added to Charting Minimap (#6737)

christof-wittreichc7e9c66b96a8
diff --git a/web/js/components/charting/chart-component.js b/web/js/components/charting/chart-component.js
index 82624f424..a85077fa4 100644
--- a/web/js/components/charting/chart-component.js
+++ b/web/js/components/charting/chart-component.js
@@ -140,7 +140,7 @@ function ChartComponent(props) {
liveData,
mapView,
createLayer,
- overviewMapLayerDef,
+ landWaterMapLayerDef,
layers,
toggleErrorDaysExpanded,
} = props;
@@ -331,18 +331,19 @@ function ChartComponent(props) {
source: new OlVectorSource({
features: [boxFeature],
}),
+ zIndex: 99,
});
const createLayerWrapper = async () => {
- const backgroundLayerGroup = await createLayer(overviewMapLayerDef);
- backgroundLayerGroup.setVisible(true);
+ const landWaterLayerGroup = await createLayer(landWaterMapLayerDef);
+ landWaterLayerGroup.setVisible(true);
const layersList = [];
- backgroundLayerGroup.getLayers().getArray()
+ landWaterLayerGroup.getLayers().getArray()
.forEach((layer) => {
layersList.push(new OlLayerTile({
source: layer.getSource(),
- zIndex: 99,
+ zIndex: 95,
}));
});
const copiedLayerGroup = new OlLayerGroup({
@@ -391,20 +392,24 @@ function ChartComponent(props) {
layerListRef.current.push(new OlLayerTile({
source: layer.getSource(),
opacity: 0.15,
+ zIndex: 97,
}));
layerListRef.current.push(new OlLayerTile({
source: layer.getSource(),
extent: coordinates,
+ zIndex: 98,
}));
});
} else {
layerListRef.current.push(new OlLayerTile({
source: foregroundLayer.getSource(),
opacity: 0.15,
+ zIndex: 97,
}));
layerListRef.current.push(new OlLayerTile({
source: foregroundLayer.getSource(),
extent: coordinates,
+ zIndex: 98,
}));
}
layerListRef.current.forEach((layer) => {
@@ -424,7 +429,7 @@ function ChartComponent(props) {
if (hoveredDate) {
createHoveredLayerWrapper();
}
- }, [overviewMapLayerDef, layerId, hoveredDate]);
+ }, [landWaterMapLayerDef, layerId, hoveredDate]);
return (
<div className="charting-chart-container">
@@ -604,12 +609,12 @@ const mapStateToProps = (state) => {
ui,
} = map;
- const layerId = 'Coastlines_15m';
+ const landWaterLayerId = 'Land_Water_Map';
return {
mapView: ui.selected.getView(),
createLayer: ui.createLayer,
- overviewMapLayerDef: layers.layerConfig[layerId],
+ landWaterMapLayerDef: layers.layerConfig[landWaterLayerId],
layers,
};
};
@@ -618,7 +623,7 @@ ChartComponent.propTypes = {
liveData: PropTypes.oneOfType([PropTypes.object, PropTypes.oneOf(['null'])]),
mapView: PropTypes.oneOfType([PropTypes.object, PropTypes.oneOf(['null'])]),
createLayer: PropTypes.func,
- overviewMapLayerDef: PropTypes.oneOfType([PropTypes.object, PropTypes.oneOf(['null'])]),
+ landWaterMapLayerDef: PropTypes.oneOfType([PropTypes.object, PropTypes.oneOf(['null'])]),
layers: PropTypes.shape,
toggleErrorDaysExpanded: PropTypes.func,
};