mirror of
https://github.com/maputnik/editor.git
synced 2026-02-11 07:00:00 +00:00
Keeps the repo clean, same as several other of our repos --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import React from 'react'
|
|
|
|
import IconLine from './IconLine'
|
|
import IconFill from './IconFill'
|
|
import IconSymbol from './IconSymbol'
|
|
import IconBackground from './IconBackground'
|
|
import IconCircle from './IconCircle'
|
|
import IconMissing from './IconMissing'
|
|
|
|
type IconLayerProps = {
|
|
type: string
|
|
style?: object
|
|
className?: string
|
|
};
|
|
|
|
export default class IconLayer extends React.Component<IconLayerProps> {
|
|
render() {
|
|
const iconProps = { style: this.props.style }
|
|
switch(this.props.type) {
|
|
case 'fill-extrusion': return <IconBackground {...iconProps} />
|
|
case 'raster': return <IconFill {...iconProps} />
|
|
case 'hillshade': return <IconFill {...iconProps} />
|
|
case 'heatmap': return <IconFill {...iconProps} />
|
|
case 'fill': return <IconFill {...iconProps} />
|
|
case 'background': return <IconBackground {...iconProps} />
|
|
case 'line': return <IconLine {...iconProps} />
|
|
case 'symbol': return <IconSymbol {...iconProps} />
|
|
case 'circle': return <IconCircle {...iconProps} />
|
|
default: return <IconMissing {...iconProps} />
|
|
}
|
|
}
|
|
}
|