import React, {FunctionComponent} from 'react' //components import CircleMarkerLayer from './CircleMarkerLayer' import HeatmapLayer from './HeatmapLayer' import PointMapLayer from './PointMapLayer' import TrackMapLayer from './TrackMapLayer' //types import { Config, GeoCircleViewLayer, GeoHeatMapViewLayer, GeoPointMapViewLayer, GeoTrackMapViewLayer, GeoViewLayer, } from '../../types' import {GeoTable} from './processing/GeoTable' interface Props { layer: GeoViewLayer preprocessedTable: GeoTable index: number stylingConfig: Partial } export const LayerSwitcher: FunctionComponent = ({ layer, preprocessedTable, index, stylingConfig, }) => { switch (layer.type) { case 'circleMap': const circleLayer = layer as GeoCircleViewLayer return ( ) case 'heatmap': const heatmapLayer = layer as GeoHeatMapViewLayer return ( ) case 'pointMap': const pointMapLayer = layer as GeoPointMapViewLayer return ( ) case 'trackMap': const trackMapLayer = layer as GeoTrackMapViewLayer return ( ) default: return null } }