Functions
Library Functions
setLibrary<T>(name: string, library: T): void
setLibrary<T>(name: string, library: T): voidSets 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
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.
Use in image/image2 property.
loadJson(url: string, options?: CachedLoadOptions<any>): Promise<any>
loadJson(url: string, options?: CachedLoadOptions<any>): Promise<any>Loads the url as JSON. The response should be a JSON file.
CachedLoadOptions
CachedLoadOptionsinterface CachedLoadOptions<T> {
headers?: Record<string, string>;
cache?: Map<string, T | Promise<T>> | false;
}Custom HTTP headers can be provided by headers.
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
getClosestStartDatetime(datetimes: DatetimeISOString[], datetime: DatetimeISOString): DatetimeISOString | undefinedGets 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
getClosestEndDatetime(datetimes: DatetimeISOString[], datetime: DatetimeISOString): DatetimeISOString | undefinedGets 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
getDatetimeWeight(startDatetime: DatetimeISOString, endDatetime: DatetimeISOString, datetime: DatetimeISOString): numberGets 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.
offsetDatetimeRange(datetime: DatetimeISOString, startHour: number, endHour: number): DatetimeISOStringRange
offsetDatetimeRange(datetime: DatetimeISOString, startHour: number, endHour: number): DatetimeISOStringRangeAdds 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>
getRasterPoints(imageProperties: ImageProperties, bounds: GeoJSON.BBox, positions: GeoJSON.Position[]): GeoJSON.FeatureCollection<GeoJSON.Point, RasterPointProperties>Gets raster points for the given positions.
Last updated