mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2025-01-17 00:34:17 +01:00
32 lines
847 B
JavaScript
32 lines
847 B
JavaScript
import React from 'react'
|
|
import PropTypes from 'prop-types'
|
|
|
|
import {latest} from '@mapbox/mapbox-gl-style-spec'
|
|
import InputBlock from '../inputs/InputBlock'
|
|
import NumberInput from '../inputs/NumberInput'
|
|
|
|
class MinZoomBlock extends React.Component {
|
|
static propTypes = {
|
|
value: PropTypes.number,
|
|
onChange: PropTypes.func.isRequired,
|
|
error: PropTypes.object,
|
|
}
|
|
|
|
render() {
|
|
return <InputBlock label={"Min Zoom"} fieldSpec={latest.layer.minzoom}
|
|
error={this.props.error}
|
|
data-wd-key="min-zoom"
|
|
>
|
|
<NumberInput
|
|
allowRange={true}
|
|
value={this.props.value}
|
|
onChange={this.props.onChange}
|
|
min={latest.layer.minzoom.minimum}
|
|
max={latest.layer.minzoom.maximum}
|
|
default={latest.layer.minzoom.minimum}
|
|
/>
|
|
</InputBlock>
|
|
}
|
|
}
|
|
|
|
export default MinZoomBlock
|