mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-27 08:45:28 +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 => {
|
||||
const {message} = error;
|
||||
const objPath = message.split(":")[0];
|
||||
unset(dirtyMapStyle, objPath);
|
||||
if (message) {
|
||||
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) => {
|
||||
console.log("test: onLayerChanged", layer);
|
||||
const changedLayers = this.state.mapStyle.layers.slice(0)
|
||||
const idx = style.indexOfLayer(changedLayers, layer.id)
|
||||
changedLayers[idx] = layer
|
||||
|
|
Loading…
Reference in a new issue