maputnik/src/components/layers/MinZoomBlock.jsx

30 lines
776 B
React
Raw Normal View History

2017-01-15 13:46:55 +01:00
import React from 'react'
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 = {
value: PropTypes.number,
onChange: PropTypes.func.isRequired,
2017-01-15 13:46:55 +01:00
}
render() {
2019-05-21 19:54:09 +02:00
return <InputBlock label={"Min Zoom"} doc={latest.layer.minzoom.doc}>
2017-01-15 13:46:55 +01:00
<NumberInput
2019-05-21 19:54:09 +02:00
wdKey="min-zoom"
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