mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-30 21:30:33 +01:00
Make range step configurable
This commit is contained in:
parent
a51fdb8435
commit
fe0df2a4ef
3 changed files with 9 additions and 1 deletions
|
@ -8,6 +8,12 @@ class NumberInput extends React.Component {
|
||||||
min: PropTypes.number,
|
min: PropTypes.number,
|
||||||
max: PropTypes.number,
|
max: PropTypes.number,
|
||||||
onChange: PropTypes.func,
|
onChange: PropTypes.func,
|
||||||
|
allowRange: PropTypes.bool,
|
||||||
|
rangeStep: PropTypes.number,
|
||||||
|
}
|
||||||
|
|
||||||
|
static defaultProps = {
|
||||||
|
rangeStep: 0.01
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
@ -80,7 +86,7 @@ class NumberInput extends React.Component {
|
||||||
style={{width: "calc(100% - 4em)", flexShrink: "0"}}
|
style={{width: "calc(100% - 4em)", flexShrink: "0"}}
|
||||||
key="range"
|
key="range"
|
||||||
type="range"
|
type="range"
|
||||||
step="0.01"
|
step={this.props.rangeStep}
|
||||||
max={this.props.max}
|
max={this.props.max}
|
||||||
min={this.props.min}
|
min={this.props.min}
|
||||||
spellCheck="false"
|
spellCheck="false"
|
||||||
|
|
|
@ -17,6 +17,7 @@ class MaxZoomBlock extends React.Component {
|
||||||
>
|
>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
allowRange={true}
|
allowRange={true}
|
||||||
|
rangeStep={0.1}
|
||||||
value={this.props.value}
|
value={this.props.value}
|
||||||
onChange={this.props.onChange}
|
onChange={this.props.onChange}
|
||||||
min={latest.layer.maxzoom.minimum}
|
min={latest.layer.maxzoom.minimum}
|
||||||
|
|
|
@ -17,6 +17,7 @@ class MinZoomBlock extends React.Component {
|
||||||
>
|
>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
allowRange={true}
|
allowRange={true}
|
||||||
|
rangeStep={0.1}
|
||||||
value={this.props.value}
|
value={this.props.value}
|
||||||
onChange={this.props.onChange}
|
onChange={this.props.onChange}
|
||||||
min={latest.layer.minzoom.minimum}
|
min={latest.layer.minzoom.minimum}
|
||||||
|
|
Loading…
Reference in a new issue