diff --git a/src/components/modals/SettingsModal.jsx b/src/components/modals/SettingsModal.jsx
index ee0baf8a..c1f96643 100644
--- a/src/components/modals/SettingsModal.jsx
+++ b/src/components/modals/SettingsModal.jsx
@@ -18,17 +18,20 @@ class SettingsModal extends React.Component {
super(props);
}
- onChange(property, e) {
- const changedStyle = this.props.mapStyle.set(property, e.target.value)
+ changeStyleProperty(property, value) {
+ const changedStyle = {
+ ...this.props.mapStyle,
+ [property]: value
+ }
this.props.onStyleChanged(changedStyle)
}
- onMetadataChange(key, value) {
+ changeMetadataProperty(property, value) {
const changedStyle = {
...this.props.mapStyle,
metadata: {
...this.props.mapStyle.metadata,
- [key]: value
+ [property]: value
}
}
this.props.onStyleChanged(changedStyle)
@@ -45,33 +48,33 @@ class SettingsModal extends React.Component {
@@ -83,7 +86,7 @@ class SettingsModal extends React.Component {
['inspection', 'Inspection Mode'],
]}
value={metadata['maputnik:renderer'] || 'mbgljs'}
- onChange={this.onMetadataChange.bind(this, 'maputnik:renderer')}
+ onChange={this.changeMetadataProperty.bind(this, 'maputnik:renderer')}
/>