# All files / types geo.ts

100% Statements 5/5
100% Branches 2/2
100% Functions 1/1
100% Lines 5/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113

    1x
    1x
    1x
    1x
    1x

     export interface GeoLayerConfig {
      type: 'geo'
      lat: number
      lon: number
      zoom: number
      allowPanAndZoom: boolean
      mapStyle?: string
      detectCoordinateFields: boolean
      useS2CellID?: boolean
      s2Column?: string
      latLonColumns?: LatLonColumns

      onViewportChange?: (lat: number, lon: number, zoom: number) => void
      onUpdateViewport?: (lat: number, lon: number, zoom: number) => void
      onUpdateQuery?: (variables: GeoQueryVariables) => void

      layers: GeoViewLayer[]
      tileServerConfiguration: TileServerConfiguration
    }

    export type GeoViewLayer =
      | GeoCircleViewLayer
      | GeoHeatMapViewLayer
      | GeoPointMapViewLayer
      | GeoTrackMapViewLayer

    export interface GeoViewLayerProperties {
      type: 'heatmap' | 'circleMap' | 'pointMap' | 'trackMap'
    }

    export type GeoHeatMapViewLayer = GeoViewLayerProperties & {
      type: 'heatmap'
      intensityField: string
      intensityDimension: Axis
      radius?: number
      blur?: number
      colors?: DashboardColor[]
    }

    export type GeoCircleViewLayer = GeoViewLayerProperties & {
      type: 'circleMap'
      radiusField?: string
      radiusDimension?: Axis
      colorField?: string
      colorDimension?: Axis
      colors?: DashboardColor[]
      radius?: number
      interpolateColors?: boolean
    }

    export enum ClusterAggregation {
      min = 'min',
      max = 'max',
      mean = 'mean',
      median = 'median',
    }

    export type GeoPointMapViewLayer = GeoViewLayerProperties & {
      type: 'pointMap'
      colorField?: string
      colorDimension?: Axis
      colors?: DashboardColor[]
      isClustered?: boolean
      maxClusterRadius?: number
      areClustersColored?: boolean
      clusterAggregationFunction?: ClusterAggregation
      tooltipColumns?: string[]
    }

    export type GeoTrackMapViewLayer = GeoViewLayerProperties & {
      type: 'trackMap'
      trackWidth?: number
      speed?: number
      randomColors?: boolean
      colors?: DashboardColor[]
      endStopMarkers?: boolean
      endStopMarkerRadius?: number
    }

    export interface Axis {
      bounds?: string[]
      label?: string
      prefix?: string
      suffix?: string
    }

    export interface DashboardColor {
      type?: 'min' | 'max' | 'threshold' | 'scale' | 'text' | 'background'
      hex: string
      value?: number
    }

    export interface TileServerConfiguration {
      tileServerUrl?: string
      bingKey?: string
    }

    export interface GeoQueryVariables {
      lon: number
      lat: number
      radius: number
    }

    export type LatLonColumns = {
      lat: LatLonColumn
      lon: LatLonColumn
    }

    export type LatLonColumn = {
      key: string
      column: string
    }