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

Grid

Implements:

Renderer for Coverages and Domains conforming to the Grid domain type of CovJSON. For Domain objects, a dummy parameter and range data is created.

See:

Example:

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

Constructor Summary

Public Constructor
public

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

The key of the parameter to display must be given in the 'parameter' options property, except when the coverage data object is a Domain object.

Member Summary

Public Members
public get

The coverage object associated to this layer.

public

The vertical reference system object, used by VerticalAxis.

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 the grid has no time axis.

public get

The time slices that make up the coverage, or undefined if the grid has no time axis .

public set

Sets the currently active vertical coordinate to the one closest to the given value.

public get

The currently active vertical coordinate as a number, or undefined if the grid has no vertical axis.

public get

The vertical slices that make up the coverage, or undefined if the grid has no vertical axis .

Method Summary

Public Methods
public

Returns the geographic bounds of the coverage.

public

Return the displayed value at a given geographic position.

Public Constructors

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

The key of the parameter to display must be given in the 'parameter' options property, except when the coverage data object is a Domain object.

Optional time and vertical axis target values can be defined with the 'time' and 'vertical' options properties. The closest values on the respective axes are 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 slice to display, defaults to the first one.

options.vertical number
  • optional

The initial vertical slice to display, defaults to the first one.

options.palette Palette
  • optional

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

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

The initial palette extent, one of subset (computed from data of current time/vertical slice), fov (computed from data in map field of view; not implemented yet), or specific: [-10,10].

Public Members

public get coverage: Coverage source

The coverage object associated to this layer.

public crsVerticalAxis: Object source

The vertical reference system object, used by VerticalAxis.

public get parameter: Parameter source

The parameter that is visualized.

public set time: Date source

Sets the currently active time to the one closest to the given Date object. Throws an exception if there is no time axis.

public get time: Date | undefined source

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

public get timeSlices: Array<Date> | undefined source

The time slices that make up the coverage, or undefined if the grid has no time axis .

public set vertical: number source

Sets the currently active vertical coordinate to the one closest to the given value.

public get vertical: number | undefined source

The currently active vertical coordinate as a number, or undefined if the grid has no vertical axis.

public get verticalSlices: Array<number> | undefined source

The vertical slices that make up the coverage, or undefined if the grid has no vertical axis .

Public Methods

public getBounds(): L.LatLngBounds source

Returns the geographic bounds of the coverage.

For projected coverages this is an approximation based on unprojecting the four bounding box corners and fitting all four points into a geographic bounding box.

Return:

L.LatLngBounds

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