mirror of
https://github.com/maputnik/editor.git
synced 2026-08-25 14:37:27 +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) {
|
onLayerChanged(layer) {
|
||||||
const changedStyle = {
|
const changedLayers = this.state.mapStyle.layers.slice(0)
|
||||||
...this.state.mapStyle,
|
const idx = style.indexOfLayer(changedLayers, layer.id)
|
||||||
layers: {
|
changedLayers[idx] = layer
|
||||||
...this.state.mapStyle.layers,
|
|
||||||
[layer.id]: layer
|
this.onLayersChange(changedLayers)
|
||||||
}
|
|
||||||
}
|
|
||||||
this.setState({ mapStyle: changedStyle })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mapRenderer() {
|
mapRenderer() {
|
||||||
|
|||||||
Reference in New Issue
Block a user