@sitn/gg-stac-explorer
v0.1.7
Published
1. Create your project based on GeoGirafe. To create a new GeoGirafe project, follow the instruction on https://gitlab.com/geogirafe/gg-viewer
Readme
Installation steps
Create your project based on GeoGirafe. To create a new GeoGirafe project, follow the instruction on https://gitlab.com/geogirafe/gg-viewer
Install this plugin using
npm i gg-stac-explorerIn
index.htmladd<stac-explorer slot="main"></stac-explorer>in the tag<girafe-lr-panel class="panel-right" dock="right">Add a button to open the panel, with the following code in the
buttonbar-grid
<button
tip="stac-explorer-panel"
slot="menu-content"
class="gg-icon-button gg-big"
onclick="
document.geogirafe.state.extendedState.stacExplorer.panelVisible =
!document.geogirafe.state.extendedState.stacExplorer.panelVisible
">
<img alt="stac-explorer-icon" src="node_modules/gg-stac-explorer/dist/stac.svg" />
</button>- In
main.ts, import and register the plugin :
- Add
import StacExplorerComponent from 'gg-stac-explorer'in the list of imports - Add
customElements.define('stac-explorer', StacExplorerComponent);in thegirafeApp.isReady()promise
Copy the translations files
node_modules/gg-stac-explorer/public/i18ninto your project, and register them in the configurationconfig.jsonfile with lines like :"fr": ["i18n/fr.json", "i18n/stac-explorer-fr.json"](Optional) Set a default STAC catalog URL by adding a
gg-stac-explorersection underextendedConfiginconfig.json:
"extendedConfig": {
"gg-stac-explorer": {
"catalogUrl": "https://sitn.ne.ch/services/stac/catalog.json"
}
}If this is not set, the STAC catalog URL field starts empty.
Usage
The panel has two tabs:
- Hierarchy browses the catalog by following its
childlinks (sub-catalogs, collections, items and assets). - Search is only available when the URL points to a STAC API landing page (with a
rel: "search"link). It lists every collection of the API, and can filter items by date range, by the current map extent and by one of the attributes exposed by the API's queryables.
