mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-28 17:51:16 +01:00
Guard against errors producing dirty map state.
This commit is contained in:
parent
29a0ef0d1c
commit
a5ac1cc93d
1 changed files with 9 additions and 3 deletions
|
@ -354,8 +354,15 @@ export default class App extends React.Component {
|
||||||
|
|
||||||
errors.forEach(error => {
|
errors.forEach(error => {
|
||||||
const {message} = error;
|
const {message} = error;
|
||||||
const objPath = message.split(":")[0];
|
if (message) {
|
||||||
unset(dirtyMapStyle, objPath);
|
try {
|
||||||
|
const objPath = message.split(":")[0];
|
||||||
|
unset(dirtyMapStyle, objPath);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.warn(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -475,7 +482,6 @@ export default class App extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
onLayerChanged = (layer) => {
|
onLayerChanged = (layer) => {
|
||||||
console.log("test: 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)
|
||||||
changedLayers[idx] = layer
|
changedLayers[idx] = layer
|
||||||
|
|
Loading…
Reference in a new issue