maputnik/src/components/layers/LayerSourceLayerBlock.jsx

32 lines
784 B
React
Raw Normal View History

import React from 'react'
import InputBlock from '../inputs/InputBlock'
import StringInput from '../inputs/StringInput'
import SelectInput from '../inputs/SelectInput'
import AutocompleteInput from '../inputs/AutocompleteInput'
class LayerSourceLayer extends React.Component {
static propTypes = {
2016-12-31 10:39:30 +01:00
value: React.PropTypes.string,
onChange: React.PropTypes.func,
sourceLayerIds: React.PropTypes.array,
}
static defaultProps = {
onChange: () => {},
sourceLayerIds: [],
}
render() {
return <InputBlock label={"Source Layer"}>
<AutocompleteInput
value={this.props.value}
onChange={this.props.onChange}
options={this.props.sourceLayerIds.map(l => [l, l])}
/>
</InputBlock>
}
}
export default LayerSourceLayer