2017-01-15 13:46:55 +01:00
|
|
|
import React from 'react'
|
2017-11-06 16:32:04 +01:00
|
|
|
import PropTypes from 'prop-types'
|
2017-01-15 13:46:55 +01:00
|
|
|
|
2018-10-06 22:05:33 +02:00
|
|
|
import {latest} from '@mapbox/mapbox-gl-style-spec'
|
2017-01-15 13:46:55 +01:00
|
|
|
import InputBlock from '../inputs/InputBlock'
|
|
|
|
import NumberInput from '../inputs/NumberInput'
|
|
|
|
|
|
|
|
class MinZoomBlock extends React.Component {
|
|
|
|
static propTypes = {
|
2017-11-06 16:32:04 +01:00
|
|
|
value: PropTypes.number,
|
|
|
|
onChange: PropTypes.func.isRequired,
|
2017-01-15 13:46:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2019-05-21 20:07:28 +02:00
|
|
|
return <InputBlock label={"Min Zoom"} doc={latest.layer.minzoom.doc}
|
|
|
|
data-wd-key="min-zoom"
|
|
|
|
>
|
2017-01-15 13:46:55 +01:00
|
|
|
<NumberInput
|
2018-10-30 21:35:22 +01:00
|
|
|
allowRange={true}
|
2017-01-15 13:46:55 +01:00
|
|
|
value={this.props.value}
|
|
|
|
onChange={this.props.onChange}
|
2018-10-06 22:05:33 +02:00
|
|
|
min={latest.layer.minzoom.minimum}
|
|
|
|
max={latest.layer.minzoom.maximum}
|
|
|
|
default={latest.layer.minzoom.minimum}
|
2017-01-15 13:46:55 +01:00
|
|
|
/>
|
|
|
|
</InputBlock>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default MinZoomBlock
|