Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Add toggle capability to dual colormaps #2306

Benjamin King7d56c0b82108
diff --git a/web/js/components/layer/settings/settings.js b/web/js/components/layer/settings/settings.js
index 096b61fac..ad6039d92 100644
--- a/web/js/components/layer/settings/settings.js
+++ b/web/js/components/layer/settings/settings.js
@@ -91,7 +91,13 @@ 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 (
+ if (legend.type === 'classification' && legend.colors.length > 1) {
+ paneItemEl = (
+ <TabPane key={legend.id + 'pane'} tabId={i}>
+ <ClassificationToggle height={Math.ceil(screenHeight / 3)} palette={palette} toggle={(classIndex) => toggleClassification(layer.id, classIndex, i, groupName)} legend={legend} />
+ </TabPane>
+ );
+ } else if (
legend.type !== 'continuous' &&
legend.type !== 'discrete' &&
legend.colors.length > 1
@@ -121,10 +127,7 @@ class LayerSettings extends React.Component {
/>
) : null
}
- {(legend.type === 'classification' && legend.colors.length > 1) ? (
- <ClassificationToggle height={Math.ceil(screenHeight / 2)} palette={palette} toggle={(classIndex) => toggleClassification(layer.id, classIndex, i, groupName)} legend={legend} />
- ) : null
- }
+
<Palette
setCustomPalette={setCustomPalette}
groupName={groupName}