Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

WV-2345, WV-2364 (#3930)

Jason Kent58bedc4e49f2
diff --git a/web/js/components/layer/settings/layer-settings.js b/web/js/components/layer/settings/layer-settings.js
index 6026e14b6..3c4687587 100644
--- a/web/js/components/layer/settings/layer-settings.js
+++ b/web/js/components/layer/settings/layer-settings.js
@@ -113,6 +113,7 @@ class LayerSettings extends React.Component {
const start = palette.min ? legend.refs.indexOf(palette.entries.refs[palette.min]) : 0;
const end = palette.max ? legend.refs.indexOf(palette.entries.refs[palette.max]) : max;
let paneItemEl;
+
if (legend.type === 'classification' && legend.colors.length > 1) {
paneItemEl = (
<TabPane key={`${legend.id}pane`} tabId={i}>
@@ -177,10 +178,10 @@ class LayerSettings extends React.Component {
navElements.push(navItemEl);
});
return (
- <>
+ <div className="double-palette">
<Nav tabs>{navElements}</Nav>
<TabContent activeTab={activeIndex}>{paneElements}</TabContent>
- </>
+ </div>
);
}
diff --git a/web/js/components/layer/settings/palette-threshold.js b/web/js/components/layer/settings/palette-threshold.js
index 11d6c1121..a88a0c4b2 100644
--- a/web/js/components/layer/settings/palette-threshold.js
+++ b/web/js/components/layer/settings/palette-threshold.js
@@ -7,7 +7,7 @@ import {
checkTemperatureUnitConversion, convertPaletteValue,
} from '../../../modules/settings/util';
-class ThresholdSelect extends React.Component {
+class PaletteThreshold extends React.Component {
constructor(props) {
super(props);
const { start, end, squashed } = props;
@@ -54,6 +54,8 @@ class ThresholdSelect extends React.Component {
const newEnd = Math.ceil(Number(thresholdArray[1]));
const startRef = legend.refs[newStart];
const endRef = legend.refs[newEnd];
+
+ // Update local state on every range-selector change but debounce threshold model update
if (newStart !== start && newEnd !== end) {
this.setState({
start: newStart,
@@ -70,12 +72,15 @@ class ThresholdSelect extends React.Component {
} else {
return;
}
- // Update local state on every range-selector change but debounce threshold model update
+
+ const { entries: { refs } } = palette;
+ const min = parseFloat(refs.indexOf(startRef));
+ const max = parseFloat(refs.lastIndexOf(endRef));
this.debounceSetRange(
layerId,
- parseFloat(palette.entries.refs.indexOf(startRef)),
- parseFloat(palette.entries.refs.indexOf(endRef)),
+ min,
+ max,
squashed,
index,
groupName,
@@ -145,7 +150,7 @@ class ThresholdSelect extends React.Component {
);
}
}
-ThresholdSelect.propTypes = {
+PaletteThreshold.propTypes = {
end: PropTypes.number,
groupName: PropTypes.string,
index: PropTypes.number,
@@ -160,4 +165,4 @@ ThresholdSelect.propTypes = {
start: PropTypes.number,
};
-export default ThresholdSelect;
+export default PaletteThreshold;
diff --git a/web/scss/features/palettes.scss b/web/scss/features/palettes.scss
index 0b9522014..ae31e7ab6 100644
--- a/web/scss/features/palettes.scss
+++ b/web/scss/features/palettes.scss
@@ -269,3 +269,7 @@
transform: rotate(-45deg);
transform-origin: 95% 0;
}
+
+.double-palette {
+ margin-bottom: 14px;
+}