Module: ol/layer/STAC

ol/layer/STAC


Classes

STACLayer

Type Definitions

Extent{Extent}

Layer{Layer}

Link{module:stac-js~Link}

Options{Object}

Properties:
Name Type Description
url string | undefined

The STAC URL. Any of url and data must be provided. Can also be used as url for data, if it is absolute and doesn't contain a self link.

data STAC | Asset | Object | undefined

The STAC metadata. Any of url and data must be provided. data take precedence over url.

assets Array.<(string|Asset)> | null
(defaults to null)

The selector for the assets to be rendered, only for STAC Items and Collections. This can be an array of strings corresponding to asset keys or Asset objects. null shows the default asset, an empty array shows no asset.

bands Array.<number> | undefined

The (one-based) bands to show.

getSourceOptions function | undefined

Optional function that can be used to configure the underlying sources. The function can do any additional work and return the completed options or a promise for the same. The function will be called with the current source options and the STAC Asset or Link. This can be useful for adding auth information such as an API token, either via query parameter or HTTP headers. Please be aware that sending HTTP headers may not be supported by all sources.

displayFootprint boolean
(defaults to true)

Allows to hide the footprints (bounding box/geometry) of the STAC object by default.

displayGeoTiffByDefault boolean
(defaults to false)

Allow to choose non-cloud-optimized GeoTiffs as default image to show, which might not work well for larger files or larger amounts of files.

displayPreview boolean
(defaults to false)

Allow to display images that a browser can display (e.g. PNG, JPEG), usually assets with role thumbnail or the link with relation type preview. The previews are usually not covering the full extents and as such may be placed incorrectly on the map. For performance reasons, it is recommended to enable this option if you pass in STAC API Items.

displayOverview boolean
(defaults to true)

Allow to display COGs and, if displayGeoTiffByDefault is enabled, GeoTiffs, usually the assets with role overview or visual.

displayWebMapLink string | boolean | Array.<(module:ol/layer/STAC~Link|string)>
(defaults to false)

Allow to display a layer based on the information provided through the web map links extension. If an array of links or link ids (property id in a Link Object) is provided, all corresponding layers will be shown. If set to true or to a specific type of web map link (pmtiles, tilejson, wms, wmts, xyz), it lets this library choose a web map link to show, but only if no other data is shown. To disable the functionality set this to false.

boundsStyle Style | undefined

The style for the overall bounds / footprint.

collectionStyle Style | undefined

The style for individual items in a list of STAC Items or Collections.

crossOrigin null | string | undefined

For thumbnails: The crossOrigin attribute for loaded images / tiles. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.

buildTileUrlTemplate function
(defaults to null)

A function that generates a URL template for a tile server (XYZ), which will be used instead of the client-side GeoTIFF rendering (except if useTileLayerAsFallback is true).

useTileLayerAsFallback boolean
(defaults to false)

Uses the given URL template only when the client-side GeoTIFF rendering fails.

opacity number
(defaults to 1)

Opacity (0, 1).

visible boolean
(defaults to true)

Visibility.

extent Extent | undefined

The bounding extent for layer rendering. The layer will not be rendered outside of this extent.

zIndex number | undefined

The z-index for layer rendering. At rendering time, the layers will be ordered, first by Z-index and then by position. When undefined, a zIndex of 0 is assumed for layers that are added to the map's layers collection, or Infinity when the layer's setMap() method was used.

minResolution number | undefined

The minimum resolution (inclusive) at which this layer will be visible.

maxResolution number | undefined

The maximum resolution (exclusive) below which this layer will be visible.

minZoom number | undefined

The minimum view zoom level (exclusive) above which this layer will be visible.

maxZoom number | undefined

The maximum view zoom level (inclusive) at which this layer will be visible.

properties Object.<string, *> | undefined

Arbitrary observable properties. Can be accessed with #get() and #set(). stac and bounds are reserved and may be overridden.

SourceOptions{SourceOptions}

Style{Style}