(map: MapInstance, id: string, props: LayerProps)
| 68 | } |
| 69 | |
| 70 | function createLayer(map: MapInstance, id: string, props: LayerProps) { |
| 71 | // @ts-ignore |
| 72 | if (map.style && map.style._loaded && (!('source' in props) || map.getSource(props.source))) { |
| 73 | const options: LayerProps = {...props, id}; |
| 74 | delete options.beforeId; |
| 75 | |
| 76 | // @ts-ignore |
| 77 | map.addLayer(options, props.beforeId); |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | /* eslint-enable complexity, max-statements */ |
| 82 |
no outgoing calls
no test coverage detected
searching dependent graphs…