Skip to content

Commit 5bae8ef

Browse files
committed
Add displayPreview and displayOverview options #651
1 parent 462de1c commit 5bae8ef

File tree

5 files changed

+29
-3
lines changed

5 files changed

+29
-3
lines changed

config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ module.exports = {
2929
apiCatalogPriority: null,
3030
useTileLayerAsFallback: false,
3131
displayGeoTiffByDefault: false,
32+
displayPreview: true,
33+
displayOverview: true,
3234
buildTileUrlTemplate: null,
3335
getMapSourceOptions: null,
3436
stacProxyUrl: null,

config.schema.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,16 @@
8282
"boolean"
8383
]
8484
},
85+
"displayPreview": {
86+
"type": [
87+
"boolean"
88+
]
89+
},
90+
"displayOverview": {
91+
"type": [
92+
"boolean"
93+
]
94+
},
8595
"buildTileUrlTemplate": {
8696
"type": [
8797
"null"

docs/options.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,23 @@ To clarify the behavior, please have a look at the following table:
365365
| true | null | client-side | none |
366366
| false | null | none | none |
367367

368+
### displayPreview
369+
370+
If set to `true` (default), displays preview images that a browser can display (e.g. PNG, JPEG) on the map as default visualization, i.e. from assets with any of the roles `thumbnail`, `overview`, or a link with relation type `preview`.
371+
The previews are often not covering the full extents and as such may be placed incorrectly on the map.
372+
373+
If both `displayPreview` and `displayOverview` (see below) are enabled, STAC Browser prefers the overviews (COGs) over the previews (PNG, JPEG, ...).
374+
375+
### displayOverview
376+
377+
If set to `true` (default), allows to display COGs and, if `displayGeoTiffByDefault` is enabled, GeoTiffs on the map as default visualization, usually from an asset with role `overview` or `visual`.
378+
368379
### displayGeoTiffByDefault
369380

370381
If set to `true`, the map also shows non-cloud-optimized GeoTiff files by default. Otherwise (`false`, default), it only shows COGs and you can only enforce showing GeoTiffs to be loaded with the "Show on map" button but they are never loaded automatically.
371-
Loading non-cloud-optimized GeoTiffs only works reliably for smaller files (< 1MB). It may also work for larger files, but it depends a lot on the underlying client hardware and software.
382+
Loading non-cloud-optimized GeoTiffs only works reliably for smaller files (< 1MB) with a certain structure. It may also work for larger files, but it depends a lot on the underlying client hardware and software.
383+
384+
Related OpenLayers issue: [openlayers#16961](https://github.com/openlayers/openlayers/issues/16961)
372385

373386
### crs
374387

src/components/Map.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ export default {
138138
children: this.items,
139139
assets: this.assets || null,
140140
displayWebMapLink: true,
141-
displayPreview: !this.items,
142141
disableMigration: true,
143142
});
144143
this.stacLayer = new StacLayer(options);

src/components/maps/MapMixin.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ register(proj4); // required to support source reprojection
2222

2323
export default {
2424
computed: {
25-
...mapState(['buildTileUrlTemplate', 'crossOriginMedia', 'displayGeoTiffByDefault', 'getMapSourceOptions', 'useTileLayerAsFallback']),
25+
...mapState(['buildTileUrlTemplate', 'crossOriginMedia', 'displayGeoTiffByDefault', 'displayPreview', 'displayOverview', 'getMapSourceOptions', 'useTileLayerAsFallback']),
2626
stacLayerOptions() {
2727
return {
2828
buildTileUrlTemplate: this.buildTileUrlTemplate,
2929
crossOriginMedia: this.crossOriginMedia,
30+
displayPreview: this.displayPreview,
31+
displayOverview: this.displayOverview,
3032
displayGeoTiffByDefault: this.displayGeoTiffByDefault,
3133
useTileLayerAsFallback: this.useTileLayerAsFallback,
3234
getSourceOptions: this.getMapSourceOptions,

0 commit comments

Comments
 (0)