Functions

License Functions

setLicense(license: License): void

Sets the license to authorize library usage.

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<TextureData>

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

GeoTIFF requires geotiff.js 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

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, startHour: number, endHour: number): DatetimeISOStringRange

Adds start hour and end hour 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