mirror of
https://github.com/maputnik/editor.git
synced 2025-12-28 09:00:02 +00:00
Fix bug with layer updates
This commit is contained in:
@@ -79,14 +79,11 @@ export default class App extends React.Component {
|
||||
}
|
||||
|
||||
onLayerChanged(layer) {
|
||||
const changedStyle = {
|
||||
...this.state.mapStyle,
|
||||
layers: {
|
||||
...this.state.mapStyle.layers,
|
||||
[layer.id]: layer
|
||||
}
|
||||
}
|
||||
this.setState({ mapStyle: changedStyle })
|
||||
const changedLayers = this.state.mapStyle.layers.slice(0)
|
||||
const idx = style.indexOfLayer(changedLayers, layer.id)
|
||||
changedLayers[idx] = layer
|
||||
|
||||
this.onLayersChange(changedLayers)
|
||||
}
|
||||
|
||||
mapRenderer() {
|
||||
|
||||
Reference in New Issue
Block a user