mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-28 16:11:15 +01:00
Remove undefined root properties.
This commit is contained in:
parent
2910efde6e
commit
0aa0dad7fb
1 changed files with 8 additions and 2 deletions
|
@ -59,9 +59,15 @@ class SettingsModal extends React.Component {
|
||||||
changeStyleProperty(property, value) {
|
changeStyleProperty(property, value) {
|
||||||
const changedStyle = {
|
const changedStyle = {
|
||||||
...this.props.mapStyle,
|
...this.props.mapStyle,
|
||||||
[property]: value
|
};
|
||||||
|
|
||||||
|
if (value === undefined) {
|
||||||
|
delete changedStyle[property];
|
||||||
}
|
}
|
||||||
this.props.onStyleChanged(changedStyle)
|
else {
|
||||||
|
changedStyle[property] = value;
|
||||||
|
}
|
||||||
|
this.props.onStyleChanged(changedStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
Loading…
Reference in a new issue