diff --git a/src/components/modals/SettingsModal.jsx b/src/components/modals/SettingsModal.jsx index aaa714d1..43f881bf 100644 --- a/src/components/modals/SettingsModal.jsx +++ b/src/components/modals/SettingsModal.jsx @@ -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() {