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

Point

Renderer for Coverages and Domains conforming to CovJSON domain type Point.

This will simply display a dot on the map and fire a click event when a user clicks on it. The dot either has a defined standard color, or it uses a palette if a parameter is chosen.

See:

Example:

var cov = ... // get Coverage data
var layer = new C.Point(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 geographic bounds of the coverage, which is a degenerate box collapsed to a point.

public

Returns the geographical position of the coverage.

public

Return the displayed value (number, or null for no-data), or undefined if no parameter is set.

public

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

Return the displayed value if within the given distance of the reference point.

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.

options.showNoData boolean
  • optional
  • default: false

Whether to draw the point if there is no data.

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 getBounds(): L.LatLngBounds source

Returns the geographic bounds of the coverage, which is a degenerate box collapsed to a point.

Return:

L.LatLngBounds

public getLatLng(): L.LatLng source

Returns the geographical position of the coverage.

Return:

L.LatLng

public getValue(): number | null | undefined source

Return the displayed value (number, or null for no-data), or undefined if no parameter is set.

Return:

number | null | undefined

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

Return the displayed value if within the given distance of the reference point. If out of bounds, then 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