WeatherLayers
DemoIntegrationsDocsStatus
  • Overview
  • WeatherLayers GL
    • Quick Start
    • Layers
      • Particle Layer
      • Raster Layer
      • Contour Layer
      • HighLow Layer
      • Front Layer
      • Grid Layer
      • Data Loading
      • Data Properties
      • Style Properties
    • Controls
      • Legend Control
      • Timeline Control
      • Tooltip Control
      • Attribution Control
      • Logo Control
      • Control
    • Types
    • Functions
    • Data Sources
    • Security
    • Troubleshooting
    • Pricing
    • Changelog
    • Roadmap
  • WeatherLayers Cloud
    • Quick Start
    • Client
    • Types
    • Security
    • Troubleshooting
    • Datasets
    • Pricing
    • Changelog
    • Roadmap
  • Contact
Powered by GitBook
On this page
  • Example
  • Data Properties
  • Style Properties
  1. WeatherLayers GL
  2. Layers

Front Layer

Last updated 1 year ago

Front data rendered as front lines with icons

Example

import { Deck } from '@deck.gl/core';
import * as WeatherLayers from 'weatherlayers-gl';

// load data
const frontData = [
  { type: WeatherLayers.FrontType.COLD, path: [...] },
  { type: WeatherLayers.FrontType.WARM, path: [...] },
  { type: WeatherLayers.FrontType.OCCLUDED, path: [...] },
  { type: WeatherLayers.FrontType.STATIONARY, path: [...] },
];

const deckgl = new Deck({
  layers: [
    new WeatherLayers.FrontLayer({
      id: 'front',
      // data properties
      data: frontData,
      // style properties
      getType: d => d.type,
      getPath: d => d.path,
      coldColor: [37, 99, 235], // Tailwind CSS blue-600
      warmColor: [220, 38, 38], // Tailwind CSS red-600
      occludedColor: [124, 58, 237], // Tailwind CSS violet-600
    }),
  ],
});

Data Properties

data

Type: DataT

The data type can be any object. Specific fields should be accessed or mapped using accessors below

Style Properties

getType

Type: (d: DataT) => WeatherLayers.FrontType

Accessor for the front type.

getPath

Type: (d: DataT) => [number, number][]

Accessor for the front path.

width

Type: number, optional

Default: 2

coldColor

Type: color [number, number, number, number?], optional

Default: [0, 0, 255]

warmColor

Type: color [number, number, number, number?], optional

Default: [255, 0, 0]

occludedColor

Type: color [number, number, number, number?], optional

Default: [148, 0, 211]

Array of data objects. See .

Width of the line. See .

Color of the line and icon for cold fronts. See .

Color of the line and icon for warm fronts. See .

Color of the line and icon for occluded fronts. See .

Layer data
LineLayer getWidth
LineLayer getColor
LineLayer getColor
LineLayer getColor
Front Layer - cold/warm/occluded weather fronts
Front Layer - stationary front