mirror of
https://github.com/maputnik/editor.git
synced 2026-06-09 16:57:26 +00:00
Remove highlighted layer from metadata in style
This commit is contained in:
@@ -110,20 +110,6 @@ export default class App extends React.Component {
|
|||||||
this.onLayersChange(changedLayers)
|
this.onLayersChange(changedLayers)
|
||||||
}
|
}
|
||||||
|
|
||||||
changeHighlightedLayer(highlight) {
|
|
||||||
const metadata = this.state.mapStyle.metadata || {}
|
|
||||||
const layers = this.state.mapStyle.layers
|
|
||||||
const highlightedLayer = highlight ? layers[this.state.selectedLayerIndex].id : null
|
|
||||||
|
|
||||||
const changedStyle = {
|
|
||||||
...this.state.mapStyle,
|
|
||||||
metadata: {
|
|
||||||
'maputnik:highlighted_layer': highlightedLayer
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.onStyleChanged(changedStyle)
|
|
||||||
}
|
|
||||||
|
|
||||||
onLayerChanged(layer) {
|
onLayerChanged(layer) {
|
||||||
const changedLayers = this.state.mapStyle.layers.slice(0)
|
const changedLayers = this.state.mapStyle.layers.slice(0)
|
||||||
const idx = style.indexOfLayer(changedLayers, layer.id)
|
const idx = style.indexOfLayer(changedLayers, layer.id)
|
||||||
@@ -188,10 +174,8 @@ export default class App extends React.Component {
|
|||||||
layer={selectedLayer}
|
layer={selectedLayer}
|
||||||
sources={this.state.sources}
|
sources={this.state.sources}
|
||||||
vectorLayers={this.state.vectorLayers}
|
vectorLayers={this.state.vectorLayers}
|
||||||
highlightLayer={metadata['maputnik:highlighted_layer'] ? true : false}
|
|
||||||
onLayerChanged={this.onLayerChanged.bind(this)}
|
onLayerChanged={this.onLayerChanged.bind(this)}
|
||||||
onLayerIdChange={this.onLayerIdChange.bind(this)}
|
onLayerIdChange={this.onLayerIdChange.bind(this)}
|
||||||
onHighlightLayerChange={this.changeHighlightedLayer.bind(this)}
|
|
||||||
/> : null
|
/> : null
|
||||||
|
|
||||||
return <AppLayout
|
return <AppLayout
|
||||||
|
|||||||
@@ -28,8 +28,6 @@ export default class LayerEditor extends React.Component {
|
|||||||
layer: React.PropTypes.object.isRequired,
|
layer: React.PropTypes.object.isRequired,
|
||||||
sources: React.PropTypes.object,
|
sources: React.PropTypes.object,
|
||||||
vectorLayers: React.PropTypes.object,
|
vectorLayers: React.PropTypes.object,
|
||||||
highlightLayer: React.PropTypes.bool,
|
|
||||||
onHighlightLayerChange: React.PropTypes.func,
|
|
||||||
onLayerChanged: React.PropTypes.func,
|
onLayerChanged: React.PropTypes.func,
|
||||||
onLayerIdChange: React.PropTypes.func,
|
onLayerIdChange: React.PropTypes.func,
|
||||||
}
|
}
|
||||||
@@ -147,13 +145,6 @@ export default class LayerEditor extends React.Component {
|
|||||||
value={this.props.layer['source-layer']}
|
value={this.props.layer['source-layer']}
|
||||||
onChange={v => this.changeProperty(null, 'source-layer', v)}
|
onChange={v => this.changeProperty(null, 'source-layer', v)}
|
||||||
/>
|
/>
|
||||||
<InputBlock label={"Inspection Mode"}>
|
|
||||||
<MultiButtonInput
|
|
||||||
value={this.props.highlightLayer ? "highlight" : "normal"}
|
|
||||||
options={[["highlight", "Highlight"], ["normal", "Normal"]]}
|
|
||||||
onChange={v => this.props.onHighlightLayerChange(v === "highlight")}
|
|
||||||
/>
|
|
||||||
</InputBlock>
|
|
||||||
</div>
|
</div>
|
||||||
case 'properties': return <PropertyGroup
|
case 'properties': return <PropertyGroup
|
||||||
layer={this.props.layer}
|
layer={this.props.layer}
|
||||||
|
|||||||
Reference in New Issue
Block a user