mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-28 16:21:16 +01:00
Remove highlighted layer from metadata in style
This commit is contained in:
parent
d1b8f8d63e
commit
e36c233b49
2 changed files with 0 additions and 25 deletions
|
@ -110,20 +110,6 @@ export default class App extends React.Component {
|
|||
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) {
|
||||
const changedLayers = this.state.mapStyle.layers.slice(0)
|
||||
const idx = style.indexOfLayer(changedLayers, layer.id)
|
||||
|
@ -188,10 +174,8 @@ export default class App extends React.Component {
|
|||
layer={selectedLayer}
|
||||
sources={this.state.sources}
|
||||
vectorLayers={this.state.vectorLayers}
|
||||
highlightLayer={metadata['maputnik:highlighted_layer'] ? true : false}
|
||||
onLayerChanged={this.onLayerChanged.bind(this)}
|
||||
onLayerIdChange={this.onLayerIdChange.bind(this)}
|
||||
onHighlightLayerChange={this.changeHighlightedLayer.bind(this)}
|
||||
/> : null
|
||||
|
||||
return <AppLayout
|
||||
|
|
|
@ -28,8 +28,6 @@ export default class LayerEditor extends React.Component {
|
|||
layer: React.PropTypes.object.isRequired,
|
||||
sources: React.PropTypes.object,
|
||||
vectorLayers: React.PropTypes.object,
|
||||
highlightLayer: React.PropTypes.bool,
|
||||
onHighlightLayerChange: React.PropTypes.func,
|
||||
onLayerChanged: React.PropTypes.func,
|
||||
onLayerIdChange: React.PropTypes.func,
|
||||
}
|
||||
|
@ -147,13 +145,6 @@ export default class LayerEditor extends React.Component {
|
|||
value={this.props.layer['source-layer']}
|
||||
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>
|
||||
case 'properties': return <PropertyGroup
|
||||
layer={this.props.layer}
|
||||
|
|
Loading…
Reference in a new issue