Functions

License Functions

setLicense(license: License): void

Sets the license to authorize library usage.

Load Functions

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

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

GeoTIFF requires geotiff.js as a peer dependency.

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

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

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.

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

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.

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

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.

offsetDatetime(datetime: DatetimeISOString, hour: number): DatetimeISOString

Adds hours to the given datetime.

offsetDatetimeRange(datetime: DatetimeISOString, start: number, end: number): DatetimeISOStringRange

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

Raster functions

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

Gets raster points for the given positions.

Last updated