mirror of
https://github.com/maputnik/editor.git
synced 2026-06-22 15:17:29 +00:00
Remove undefined root properties.
This commit is contained in:
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user