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

Trajectory

Mixin Extends:

L.FeatureGroup, CoverageMixin, PaletteMixin

Implements:

Renderer for Coverages and Domains conforming to the CovJSON domain type Trajectory.

Displays the trajectory as a path with coloured points using a given palette for a given parameter.

See:

Example:

var cov = ... // get Coverage data
var layer = new C.Trajectory(cov, {
  parameter: 'salinity',
  defaultColor: 'black',
  palette: C.linearPalette(['#FFFFFF', '#000000'])
})

Constructor Summary

Public Constructor
public

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

Member Summary

Public Members
public get

The coverage object associated to this layer.

public get

The parameter that is visualized.

Method Summary

Public Methods
public

Returns the trajectory points as LatLng objects in the order they appear in the composite domain axis.

public

getValueAt(latlng: L.LatLng, maxDistance: number): number | null | undefined

Return the displayed value closest to the circle centre.

public

redraw()

Redraw the layer.

Public Constructors

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

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.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 Methods

public getLatLngs(): Array<L.LatLng> source

Returns the trajectory points as LatLng objects in the order they appear in the composite domain axis.

Return:

Array<L.LatLng>

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

Return the displayed value closest to the circle centre. If no point exists within the circle, undefined is returned, otherwise a number or null (for no-data).

Params:

NameTypeAttributeDescription
latlng L.LatLng
maxDistance number

Maximum distance in meters between both points.

Return:

number | null | undefined

public redraw() source

Redraw the layer.