Interactive interface for browsing global, full-resolution satellite imagery
Template vector settings for filters and styles
ZachTRice654c9ffbb704
diff --git a/web/js/components/layer/settings/settings.js b/web/js/components/layer/settings/settings.jsindex c55836f1f..7ae68d6ed 100644--- a/web/js/components/layer/settings/settings.js+++ b/web/js/components/layer/settings/settings.js@@ -27,7 +27,6 @@ import {} from '../../../modules/palettes/actions';import {- getCustomVectorStyle,getVectorStyle} from '../../../modules/vector-styles/selectors';import { setOpacity } from '../../../modules/layers/actions';@@ -160,7 +159,6 @@ class LayerSettings extends React.Component {if (!legends) return '';const len = legends.length;const palette = getPalette(layer.id, 0);- const vectorStyle = getVectorStyle(layer.id, 0);const legend = getLegend(layer.id, 0);const max = palette.legend.colors.length - 1;const start = palette.min || 0;@@ -173,7 +171,7 @@ class LayerSettings extends React.Component {return (<React.Fragment>- {legend.type !== 'classification' ? (+ {legend.type !== 'classification' &&<PaletteThresholdlegend={legend}setRange={setRange}@@ -186,9 +184,7 @@ class LayerSettings extends React.Component {groupName={groupName}index={0}/>- ) : (- ''- )}+ }<PalettesetCustom={setCustomPalette}clearCustom={clearCustom}@@ -203,8 +199,28 @@ class LayerSettings extends React.Component {index={0}paletteOrder={paletteOrder}/>+ </React.Fragment>+ );+ }+ /**+ * Render Opacity, threshold, and custom palette options+ */+ renderVectorStyles() {+ const {+ setRange,+ groupName,+ layer+ } = this.props;+ // const vectorStyle = getVectorStyle(layer.id, 0);+ const max = 100; // Placeholder+ // const start = vectorStyle.min || 0;+ const start = 0; // Placeholder+ // const end = vectorStyle.max || max;+ const end = max; // Placeholder++ return (+ <React.Fragment><VectorThreshold- legend={legend}setRange={setRange}min={0}max={max}@@ -212,12 +228,10 @@ class LayerSettings extends React.Component {groupName={groupName}end={end}layerId={layer.id}- squashed={!!palette.squash}- index={i}+ index={0}/><VectorStyle- getCustomVectorStyle={getCustomVectorStyle}- activePalette={'default_style'}+ activeVectorStyle={'default_style'}layer={layer}index={0}/>@@ -225,16 +239,22 @@ class LayerSettings extends React.Component {);}render() {+ var renderCustomizations;const {setOpacity,customPalettesIsActive,layer,palettedAllowed} = this.props;- const customPalettes =- customPalettesIsActive && palettedAllowed && layer.palette- ? this.renderCustoms()- : '';++ if (layer.type !== 'vector') {+ renderCustomizations =+ customPalettesIsActive && palettedAllowed && layer.palette+ ? this.renderCustoms()+ : '';+ } else {+ renderCustomizations = this.renderVectorStyles();+ }if (!layer.id) return '';return (@@ -244,7 +264,7 @@ class LayerSettings extends React.Component {setOpacity={setOpacity}layer={layer}/>- {customPalettes}+ {renderCustomizations}</React.Fragment>);}diff --git a/web/js/components/layer/settings/vector-style.js b/web/js/components/layer/settings/vector-style.jsindex 9352c07e8..f0a0abdde 100644--- a/web/js/components/layer/settings/vector-style.js+++ b/web/js/components/layer/settings/vector-style.js@@ -110,8 +110,7 @@ class VectorStyleSelect extends React.Component {);}render() {- const { index, layer, paletteOrder } = this.props;- const recommended = layer.palette.recommended || [];+ const { index } = this.props;return (<div@@ -120,15 +119,7 @@ class VectorStyleSelect extends React.Component {><h2 className="wv-header">Vector Style</h2><Scrollbar style={{ maxHeight: '200px' }}>- {this.renderDefault()}- {paletteOrder.map(id => {- if (lodashIndexOf(recommended, id) < 0) {- var item = this.customLegend(id);- if (item) {- return item;- }- }- })}+ {/* Output Color Selects Here */}</Scrollbar></div>);diff --git a/web/js/components/layer/settings/vector-threshold.js b/web/js/components/layer/settings/vector-threshold.jsindex 0809c57ed..5165f7d0f 100644--- a/web/js/components/layer/settings/vector-threshold.js+++ b/web/js/components/layer/settings/vector-threshold.js@@ -11,29 +11,10 @@ class VectorThresholdSelect extends React.Component {this.state = {start: props.start,end: props.end,- squashed: props.squashed,activeDragger: 'start'};this.debounceSetRange = lodashDebounce(props.setRange, 300);}- /**- * Apply squash- * @param {Boolean} boo- */- updateSquash(boo) {- const { setRange, layerId, index, groupName } = this.props;- const { start, end, squashed } = this.state;- const isSquashed = !squashed;- setRange(- layerId,- parseFloat(start),- parseFloat(end),- isSquashed,- index,- groupName- );- this.setState({ squashed: isSquashed });- }/*** Update threshold values* @param {Array} thresholdArray | Array of start/end indexs for colormap@@ -65,26 +46,18 @@ class VectorThresholdSelect extends React.Component {layerId,parseFloat(newStart),parseFloat(newEnd),- this.state.squashed,index,groupName);}render() {- const { start, end, squashed } = this.state;- const { index, min, max, legend } = this.props;- const units = legend.units || '';- const startLabel =- start === 0 && legend.minLabel- ? legend.minLabel + ' ' + units- : legend.tooltips[start] + ' ' + units;- const endLabel =- end === legend.tooltips.length - 1 && legend.maxLabel- ? legend.maxLabel + ' ' + units- : legend.tooltips[end] + ' ' + units;+ const { start, end } = this.state;+ const { index, min, max } = this.props;+ const startLabel = 0; // Placeholder+ const endLabel = 100; // Placeholderreturn (<div className="layer-threshold-select settings-component">- <h2 className="wv-header">Thresholds</h2>+ <h2 className="wv-header">Filters</h2><divid={'wv-layer-options-threshold' + index}className="wv-layer-options-threshold"@@ -115,10 +88,8 @@ VectorThresholdSelect.propTypes = {index: PropTypes.number,min: PropTypes.number,max: PropTypes.number,- legend: PropTypes.object,setRange: PropTypes.func,layerId: PropTypes.string,- squashed: PropTypes.bool,groupName: PropTypes.string};diff --git a/web/js/map/layerbuilder.js b/web/js/map/layerbuilder.jsindex 69b7ccdf0..e824aaf70 100644--- a/web/js/map/layerbuilder.js+++ b/web/js/map/layerbuilder.js@@ -396,7 +396,6 @@ export function mapLayerBuilder(models, config, cache, mapUi, store) {var vectorStyles = config.vectorStyles;var vectorStyle = def.vectorStyle.id;// var glStyle = vectorStyles[vectorStyle];- console.log(vectorStyle);var glStyle = vectorStyles[vectorStyle];// if (glStyle === undefined) {// glStyle = vectorStyles[vectorStyle];