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
  • Library Functions
  • Load Functions
  • Datetime Functions
  • Raster functions
  1. WeatherLayers GL

Functions

Last updated 2 months ago

Library Functions

setLibrary<T>(name: string, library: T): void

Sets an optional dependency.

By default, optional dependencies are loaded with a dynamic import. If the dynamic import is not supported by your environment, use this function to set the optional dependency explicitly.

Load Functions

loadTextureData(url: string, cache?: Map<string, any> | false = DEFAULT_CACHE): Promise<>

Loads the url as texture data. The url should be PNG, WebP or GeoTIFF image.

GeoTIFF requires as an optional dependency if loading GeoTIFF images.

The response is cached to the given cache, or to the default global cache, or caching can be disabled by false.

Use in image/image2 property.

loadJson(url: string, cache?: Map<string, any> | false = DEFAULT_CACHE): Promise<string>

Loads the url as JSON. The response should be a JSON file.

The response is cached to the given cache, or to the default global cache, or caching can be disabled by false.

Datetime Functions

Gets the closest start datetime (i.e. lower or equal) for the given datetime from the given datetimes.

Use to find the correct start image to load, to be used in image property.

Gets the closest end datetime (i.e. greater or equal) for the given datetime from the given datetimes.

Use to find the correct end image to load, to be used in image2 property. Applicable only if datetimeInterpolate is enabled.

Gets the datetime weight between the given start and end datetime for the given datetime. The returned value is a number 0-1.

Use in imageWeight property. Applicable only if datetimeInterpolate is enabled.

Adds hours to the given datetime.

Adds start hour and end hour to the given datetime. The returned value is a datetime range.

Raster functions

Gets raster points for the given positions.

getClosestStartDatetime(datetimes: [], datetime: ): | undefined

getClosestEndDatetime(datetimes: [], datetime: ): | undefined

getDatetimeWeight(startDatetime: , endDatetime: , datetime: ): number

offsetDatetime(datetime: , hour: number):

offsetDatetimeRange(datetime: , startHour: number, endHour: number):

getRasterPoints(imageProperties: , bounds: GeoJSON.BBox, positions: GeoJSON.Position[]): GeoJSON.FeatureCollection<GeoJSON.Point, >

geotiff.js
TextureData
DatetimeISOString
DatetimeISOString
DatetimeISOString
DatetimeISOString
DatetimeISOString
DatetimeISOString
DatetimeISOString
DatetimeISOString
DatetimeISOString
DatetimeISOString
DatetimeISOString
DatetimeISOString
DatetimeISOStringRange
ImageProperties
RasterPointProperties