mirror of
https://github.com/maputnik/editor.git
synced 2026-08-26 06:57:26 +00:00
Allow removal of light/transition properties.
This commit is contained in:
@@ -21,25 +21,39 @@ class SettingsModal extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
changeTransitionProperty(property, value) {
|
changeTransitionProperty(property, value) {
|
||||||
const changedStyle = {
|
const transition = {
|
||||||
...this.props.mapStyle,
|
...this.props.mapStyle.transition,
|
||||||
transition: {
|
|
||||||
...this.props.mapStyle.transition,
|
|
||||||
[property]: value
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.props.onStyleChanged(changedStyle)
|
|
||||||
|
if (value === undefined) {
|
||||||
|
delete transition[property];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
transition[property] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.props.onStyleChanged({
|
||||||
|
...this.props.mapStyle,
|
||||||
|
transition,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
changeLightProperty(property, value) {
|
changeLightProperty(property, value) {
|
||||||
const changedStyle = {
|
const light = {
|
||||||
...this.props.mapStyle,
|
...this.props.mapStyle.light,
|
||||||
light: {
|
|
||||||
...this.props.mapStyle.light,
|
|
||||||
[property]: value
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.props.onStyleChanged(changedStyle)
|
|
||||||
|
if (value === undefined) {
|
||||||
|
delete light[property];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
light[property] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.props.onStyleChanged({
|
||||||
|
...this.props.mapStyle,
|
||||||
|
light,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
changeStyleProperty(property, value) {
|
changeStyleProperty(property, value) {
|
||||||
|
|||||||
Reference in New Issue
Block a user