mirror of
https://github.com/maputnik/editor.git
synced 2026-08-24 22:17:25 +00:00
Added support for transition root property
This commit is contained in:
@@ -20,6 +20,17 @@ class SettingsModal extends React.Component {
|
|||||||
onOpenToggle: PropTypes.func.isRequired,
|
onOpenToggle: PropTypes.func.isRequired,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
changeTransitionProperty(property, value) {
|
||||||
|
const changedStyle = {
|
||||||
|
...this.props.mapStyle,
|
||||||
|
transition: {
|
||||||
|
...this.props.mapStyle.transition,
|
||||||
|
[property]: value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.props.onStyleChanged(changedStyle)
|
||||||
|
}
|
||||||
|
|
||||||
changeLightProperty(property, value) {
|
changeLightProperty(property, value) {
|
||||||
const changedStyle = {
|
const changedStyle = {
|
||||||
...this.props.mapStyle,
|
...this.props.mapStyle,
|
||||||
@@ -45,6 +56,7 @@ class SettingsModal extends React.Component {
|
|||||||
const inputProps = { }
|
const inputProps = { }
|
||||||
|
|
||||||
const light = this.props.mapStyle.light || {};
|
const light = this.props.mapStyle.light || {};
|
||||||
|
const transition = this.props.mapStyle.transition || {};
|
||||||
|
|
||||||
return <Modal
|
return <Modal
|
||||||
data-wd-key="modal-settings"
|
data-wd-key="modal-settings"
|
||||||
@@ -182,6 +194,24 @@ class SettingsModal extends React.Component {
|
|||||||
/>
|
/>
|
||||||
</InputBlock>
|
</InputBlock>
|
||||||
|
|
||||||
|
<InputBlock label={"Transition delay"} doc={latest.transition.delay.doc}>
|
||||||
|
<NumberInput
|
||||||
|
{...inputProps}
|
||||||
|
value={transition.delay}
|
||||||
|
default={latest.transition.delay.default}
|
||||||
|
onChange={this.changeTransitionProperty.bind(this, "delay")}
|
||||||
|
/>
|
||||||
|
</InputBlock>
|
||||||
|
|
||||||
|
<InputBlock label={"Transition duration"} doc={latest.transition.duration.doc}>
|
||||||
|
<NumberInput
|
||||||
|
{...inputProps}
|
||||||
|
value={transition.duration}
|
||||||
|
default={latest.transition.duration.default}
|
||||||
|
onChange={this.changeTransitionProperty.bind(this, "duration")}
|
||||||
|
/>
|
||||||
|
</InputBlock>
|
||||||
|
|
||||||
<InputBlock label={"Style Renderer"} doc={"Choose the default Maputnik renderer for this style."}>
|
<InputBlock label={"Style Renderer"} doc={"Choose the default Maputnik renderer for this style."}>
|
||||||
<SelectInput {...inputProps}
|
<SelectInput {...inputProps}
|
||||||
data-wd-key="modal-settings.maputnik:renderer"
|
data-wd-key="modal-settings.maputnik:renderer"
|
||||||
|
|||||||
Reference in New Issue
Block a user