mirror of
https://github.com/maputnik/editor.git
synced 2026-12-04 15:54:24 +00:00
Fix bug with layer updates
This commit is contained in:
1 parent
cb590d7e26
commit
97b665485e
1 file changed
+5
-8
@@ -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