diff --git a/src/components/fields/SpecField.jsx b/src/components/fields/SpecField.jsx index cfede69..99afb22 100644 --- a/src/components/fields/SpecField.jsx +++ b/src/components/fields/SpecField.jsx @@ -76,6 +76,7 @@ export default class SpecField extends React.Component { } else { return } diff --git a/src/components/fields/ZoomSpecField.jsx b/src/components/fields/ZoomSpecField.jsx index 596e298..8205b45 100644 --- a/src/components/fields/ZoomSpecField.jsx +++ b/src/components/fields/ZoomSpecField.jsx @@ -182,7 +182,7 @@ export default class ZoomSpecField extends React.Component { } cursorTargetStyle={{ cursor: 'pointer' }} - doc="Turn property into a zoom function to enable a map feature to change with map's zoom level." + doc={"Turn property into a zoom function to enable a map feature to change with map's zoom level."} /> } diff --git a/src/components/filter/FilterEditor.jsx b/src/components/filter/FilterEditor.jsx index 6f7f0cc..ad00628 100644 --- a/src/components/filter/FilterEditor.jsx +++ b/src/components/filter/FilterEditor.jsx @@ -75,9 +75,8 @@ export default class CombiningFilterEditor extends React.Component { let filters = filter.slice(1) const editorBlocks = filters.map((f, idx) => { - return + return this.changeValue(e.target.value)} - onBlur={() => this.props.onChange(this.state.value)} + onChange={e => this.setState({ value: e.target.value })} + onBlur={() => { + if(this.state.value) this.props.onChange(this.state.value) + }} /> } } diff --git a/src/components/map/FeatureLayerPopup.jsx b/src/components/map/FeatureLayerPopup.jsx index 31dc2d6..2f82c9b 100644 --- a/src/components/map/FeatureLayerPopup.jsx +++ b/src/components/map/FeatureLayerPopup.jsx @@ -16,12 +16,6 @@ const Panel = (props) => { }}>{props.children} } -function renderFeature(feature) { - return
- {feature.layer['source-layer']} -
-} - function groupFeaturesBySourceLayer(features) { const sources = {} features.forEach(feature => { @@ -52,7 +46,7 @@ class FeatureLayerPopup extends React.Component { {feature.layer.id} }) - return
+ return
{vectorLayerId} {layers}
diff --git a/src/components/map/FeaturePropertyPopup.jsx b/src/components/map/FeaturePropertyPopup.jsx index e61c1b5..1d5e6e3 100644 --- a/src/components/map/FeaturePropertyPopup.jsx +++ b/src/components/map/FeaturePropertyPopup.jsx @@ -5,11 +5,20 @@ import StringInput from '../inputs/StringInput' import colors from '../../config/colors' import { margins, fontSizes } from '../../config/scales' +function displayValue(value) { + if (typeof value === 'undefined' || value === null) return value; + if (value instanceof Date) return value.toLocaleString(); + if (typeof value === 'object' || + typeof value === 'number' || + typeof value === 'string') return value.toString(); + return value; +} + function renderProperties(feature) { return Object.keys(feature.properties).map(propertyName => { const property = feature.properties[propertyName] - return - + return + }) } @@ -24,7 +33,7 @@ const Panel = (props) => { } function renderFeature(feature) { - return
+ return
{feature.layer['source-layer']} {renderProperties(feature)}