Classes
Type Definitions
-
APICollection{module:stac-js~APICollection}
-
-
Extent{Extent}
-
-
GetHeadersFn{GetHeadersFn}
-
-
Layer{js}
-
-
LayerOptions
-
-
Link{module:stac-js~Link}
-
-
-
Map{js}
-
-
OnErrorFn{OnErrorFn}
-
-
Options{Object}
-
Properties:
Name Type Description urlstring | undefined The STAC URL. Any of
urlanddatamust be provided. Can also be used as url for data, if it is absolute and doesn't contain a self link. Don't use this is you pass in a stac-js object asdata, set the url manually throughsetAbsoluteUrlon the stac-js object before passing it in.dataSTAC | Asset | Object | undefined The STAC metadata. Any of
urlanddatamust be provided.datatake precedence overurl.childrenAPICollection | Object | Array.<(module:ol/layer/STAC~STAC|Object)> | null
(defaults to null)For STAC Catalogs and Collections, any child entites to show. Can be STAC ItemCollections (as ItemCollection or GeoJSON FeatureCollection) or a list of STAC entities.
childrenOptionsOptions
(defaults to {})The the given children, apply the given options.
assetsArray.<(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.
bandsArray.<(number|string)> | undefined The bands to show. One-based index of the band, or the name of the band.
getSourceOptionsfunction | 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 advanced per-source customization such as signed URLs. To add credentials via query parameters, use the
getRequestUrloption instead; to send credentials via HTTP headers, use thegetRequestHeadersoption instead.getLayerOptionsfunction | undefined Optional function that can be used to configure the individual layers that are created for the assets and links. The function can do any additional (asynchronous) work and return the completed options or a promise for the same. The function will be called with the layer type, the current layer options and the STAC Asset or Link. This can be useful to customize the layers, e.g. to apply a style to a GeoTIFF or GeoZarr layer that is loaded from the STAC metadata.
displayFootprintboolean
(defaults to true)Allows to hide the footprints (bounding box/geometry) of the STAC object by default.
displayGeoTiffByDefaultboolean
(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.
displayPreviewboolean
(defaults to false)Allow to display preview images that a browser can display (e.g. PNG, JPEG), i.e. assets with any of the roles
thumbnail,overview, or a link with relation typepreview. 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 instead ofdisplayOverview.displayOverviewboolean
(defaults to true)Allow to display COGs, Zarr and, if
displayGeoTiffByDefaultis enabled, GeoTiffs, usually an asset with roleovervieworvisual. Zarr assets other than Web-Optimized Zarr are only displayed if the STAC metadata declares what to render (see the datacube extension) and the store is within themaxDisplayPixelslimit.maxDisplayPixelsnumber
(defaults to 16777216)The maximum number of pixels the coarsest resolution level of a GeoTIFF or Zarr asset may have to be displayed client-side, as displaying the full extent of an asset loads every tile of that level. Files without (sufficient) overviews can easily exceed this limit. Larger assets are not chosen for the default visualization, and selecting one explicitly through
assetsreports an error through theerrorevent (or renders through the tile server ifbuildTileUrlTemplateanduseTileLayerAsFallbackare set). Set toInfinityto display assets of any size.displayWebMapLinkstring | 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
idin 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 tofalse.styleStyle | null
(defaults to null)The style for GeoTIFF and GeoZarr layers (WebGLTileLayer style).
defaultColormapArray.<(module:ol/color.js~Color|string)> | null
(defaults to null)The colors of the colormap that is used for continuous single-band data when neither the STAC metadata nor the
styleoption define a coloring. The colors are evenly distributed over the value range of the data (e.g. from the STACstatistics). If not set, the data is stretched to grayscale.boundsStyleStyle | undefined The style for the overall bounds / footprint.
collectionStyleStyle | undefined The style for individual children in a list of STAC Items or Collections.
crossOriginnull | string | undefined For thumbnails: The
crossOriginattribute for loaded images / tiles. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.buildTileUrlTemplatefunction
(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
useTileLayerAsFallbackistrue). The function provided can return a promise (i.e. be async) or a string. The function can returnnullto not pass the given asset or link to the tile server, e.g. to filter by media type or protocol. In this case client-side rendering is used instead.useTileLayerAsFallbackboolean
(defaults to false)Uses the given URL template only when the client-side GeoTIFF rendering fails.
opacitynumber
(defaults to 1)Opacity (0, 1).
visibleboolean
(defaults to true)Visibility.
extentExtent | undefined The bounding extent for layer rendering. The layer will not be rendered outside of this extent.
zIndexnumber | 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, azIndexof 0 is assumed for layers that are added to the map'slayerscollection, orInfinitywhen the layer'ssetMap()method was used.minResolutionnumber | undefined The minimum resolution (inclusive) at which this layer will be visible.
maxResolutionnumber | undefined The maximum resolution (exclusive) below which this layer will be visible.
minZoomnumber | undefined The minimum view zoom level (exclusive) above which this layer will be visible.
maxZoomnumber | undefined The maximum view zoom level (inclusive) at which this layer will be visible.
propertiesObject.<string, *> | undefined Arbitrary observable properties. Can be accessed with
#get()and#set().stacandboundsare reserved and may be overridden.disableMigrationboolean
(defaults to false)Disable the migration of the STAC object to the latest version. Only enable this if you are sure that the STAC object is already in the latest version.
httpRequestFnfunction
(defaults to null)Sets a custom function to make HTTP requests with. The first parameter is the URL to request and the output is a promise that resolves with the response body. The second parameter is the return type, either
json(default) ortext. The STAC Asset or Link the request is made for is passed as third parameter, if available.getRequestHeadersObject.<string, string> | function
(defaults to null)The HTTP headers (e.g. for authentication) to send with the requests made by this layer, either as a plain object or as a function that returns the headers (or
nullfor none) and is called with the STAC Asset or Link that is shown (if available) and the URL that is requested. Use a function to restrict the headers to specific hosts, as tile server URLs and asset URLs may point to hosts that should not receive the credentials. The headers are attached to requests made by the defaulthttpRequestFn, to GeoTIFF, GeoZarr and PMTiles requests, and via image/tile load functions (through the Fetch API and object URLs) to preview images and XYZ, TileJSON, WMS and WMTS tiles.getRequestUrlfunction
(defaults to null)Rewrites a URL before a request is made or a source is created, e.g. to append query parameters for authentication (signed URLs, API keys). The function is called with the STAC Asset or Link that is shown (if available), the URL, and whether the URL is a tile URL template. It returns the new URL or
nullto keep the URL unchanged. The rewrite is applied to the initial source URL beforegetSourceOptionsis called; templates discovered in fetched documents (TileJSON manifests, WMTS capabilities) are rewritten afterwards and are not passed togetSourceOptions. For tiled sources the tile URL template is rewritten, not the individual tile URLs. URL templates originate from XYZ web map links, TileJSON manifests, WMTS links (uriTemplate) and capabilities, andbuildTileUrlTemplate. The returned URL must keep the template placeholders such as{z}unchanged, i.e. they must not be percent-encoded (e.g. through URL normalization). -
STAC{module:stac-js~STAC}
-
-
STACObject{module:stac-js~STACObject}
-
-
SourceOptions
-
-
Style{js}
-