Remove undefined root properties.

This commit is contained in:
orangemug 2019-10-16 22:31:29 +01:00
parent 2910efde6e
commit 0aa0dad7fb

View file

@ -59,9 +59,15 @@ class SettingsModal extends React.Component {
changeStyleProperty(property, value) {
const changedStyle = {
...this.props.mapStyle,
[property]: value
};
if (value === undefined) {
delete changedStyle[property];
}
this.props.onStyleChanged(changedStyle)
else {
changedStyle[property] = value;
}
this.props.onStyleChanged(changedStyle);
}
render() {