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
|
|
|
|
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 = {
|
2017-11-06 16:32:04 +01:00
|
|
|
value: PropTypes.number,
|
|
|
|
onChange: PropTypes.func.isRequired,
|
2017-01-15 13:46:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2017-04-10 14:29:57 +02:00
|
|
|
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}
|
2017-04-10 14:29:57 +02:00
|
|
|
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
|