Home Reference Source Repository
import {PolygonSeries} from 'leaflet-coverage/'
public class | source

PolygonSeries

Implements:

Renderer for Coverages conforming to the CovJSON domain type PolygonSeries.

See:

Example:

var cov = ... // get Coverage data
var layer = new C.PolygonSeries(cov, {
  parameter: 'salinity',
  time: new Date('2015-01-01T12:00:00Z'),
  defaultColor: 'black',
  palette: C.linearPalette(['#FFFFFF', '#000000'])
})

Constructor Summary

Public Constructor
public

constructor(cov: Coverage | Domain, options: Object)

An optional time axis target value can be defined with the 'time' property.

Member Summary

Public Members
public get

The coverage object associated to this layer.

public get

The parameter that is visualized.

public set

Sets the currently active time to the one closest to the given Date object.

public get

The currently active time on the temporal axis as Date object, or undefined if no time is set.

public get

The time slices that make up the coverage.

Method Summary

Public Methods
public

Returns the geographic bounds of the coverage.

public

Returns the geographical center position of the coverage based on its bounding box.

public

Return the displayed value (number, or null for no-data), or undefined if not fixed to a t-coordinate or parameter.

public

Return the displayed value at a given geographic position.

public

redraw()

Redraw the layer.

Public Constructors

public constructor(cov: Coverage | Domain, options: Object) source

An optional time axis target value can be defined with the 'time' property. The closest values on the time axis is chosen.

Params:

NameTypeAttributeDescription
cov Coverage | Domain

The coverage or domain object to visualize.

options Object
  • optional

The options object.

options.parameter string
  • optional

The key of the parameter to display, not needed for domain objects.

options.time Date
  • optional

The initial time step to display.

options.palette Palette
  • optional

The initial color palette to use, the default depends on the parameter type.

options.paletteExtent string
  • optional
  • default: 'full'

The initial palette extent, either 'full' or specific: [-10,10].

options.defaultColor string
  • optional
  • default: 'black'

The color to use for missing data or if no parameter is set.

Public Members

public get coverage: Coverage source

The coverage object associated to this layer.

public get parameter: Parameter source

The parameter that is visualized.

public set time: Date | undefined source

Sets the currently active time to the one closest to the given Date object.

public get time: Date | undefined source

The currently active time on the temporal axis as Date object, or undefined if no time is set.

public get timeSlices: Array<Date> source

The time slices that make up the coverage.

Public Methods

public getBounds(): L.LatLngBounds source

Returns the geographic bounds of the coverage.

Return:

L.LatLngBounds

public getLatLng(): L.LatLng source

Returns the geographical center position of the coverage based on its bounding box.

Return:

L.LatLng

public getValue(): number | null | undefined source

Return the displayed value (number, or null for no-data), or undefined if not fixed to a t-coordinate or parameter.

Return:

number | null | undefined

public getValueAt(latlng: L.LatLng): number | null | undefined source

Return the displayed value at a given geographic position. If out of bounds, then undefined is returned, otherwise a number or null (for no data).

Params:

NameTypeAttributeDescription
latlng L.LatLng

Return:

number | null | undefined

public redraw() source

Redraw the layer.