maputnik/src/components/layers/MaxZoomBlock.jsx

28 lines
777 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
2017-11-07 11:21:39 +01:00
import styleSpec from '@mapbox/mapbox-gl-style-spec/style-spec'
2017-01-15 13:46:55 +01:00
import InputBlock from '../inputs/InputBlock'
import NumberInput from '../inputs/NumberInput'
class MaxZoomBlock extends React.Component {
static propTypes = {
value: PropTypes.number,
onChange: PropTypes.func.isRequired,
2017-01-15 13:46:55 +01:00
}
render() {
return <InputBlock label={"Max Zoom"} doc={styleSpec.latest.layer.maxzoom.doc}>
2017-01-15 13:46:55 +01:00
<NumberInput
value={this.props.value}
onChange={this.props.onChange}
min={styleSpec.latest.layer.maxzoom.minimum}
max={styleSpec.latest.layer.maxzoom.maximum}
default={styleSpec.latest.layer.maxzoom.maximum}
2017-01-15 13:46:55 +01:00
/>
</InputBlock>
}
}
export default MaxZoomBlock