mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-26 16:50:37 +01:00
Fix layer drag&drop and init warning
This commit is contained in:
parent
af2629be75
commit
a8f6208561
1 changed files with 5 additions and 5 deletions
|
@ -486,7 +486,7 @@ export default class App extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
layers = layers.slice(0);
|
layers = layers.slice(0);
|
||||||
layers = arrayMoveMutable(layers, oldIndex, newIndex);
|
arrayMoveMutable(layers, oldIndex, newIndex);
|
||||||
this.onLayersChange(layers);
|
this.onLayersChange(layers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -764,17 +764,17 @@ export default class App extends React.Component {
|
||||||
parseInt(parts[1], 10),
|
parseInt(parts[1], 10),
|
||||||
];
|
];
|
||||||
|
|
||||||
let invalid = false;
|
let valid = true;
|
||||||
if (hashVal !== "-") {
|
if (hashVal !== "-") {
|
||||||
const currentHashVal = hash(JSON.stringify(mapStyle));
|
const currentHashVal = hash(JSON.stringify(mapStyle));
|
||||||
if (currentHashVal !== parseInt(hashVal, 10)) {
|
if (currentHashVal !== parseInt(hashVal, 10)) {
|
||||||
invalid = true;
|
valid = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!invalid) {
|
if (valid) {
|
||||||
this.setState({
|
this.setState({
|
||||||
selectedLayerIndex,
|
selectedLayerIndex,
|
||||||
selectedLayerOriginalId: this.state.mapStyle.layers[selectedLayerIndex].id,
|
selectedLayerOriginalId: mapStyle.layers[selectedLayerIndex].id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue