ol-stac 1.0.0-beta.1 → 1.0.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -12
- package/events/ErrorEvent.d.ts +3 -0
- package/events/ErrorEvent.d.ts.map +1 -1
- package/events/ErrorEvent.js +3 -0
- package/events/ErrorEvent.js.map +1 -1
- package/layer/STAC.d.ts +105 -66
- package/layer/STAC.d.ts.map +1 -1
- package/layer/STAC.js +261 -90
- package/layer/STAC.js.map +1 -1
- package/package.json +13 -6
- package/source/type.d.ts +110 -0
- package/source/type.d.ts.map +1 -0
- package/source/type.js +104 -0
- package/source/type.js.map +1 -0
- package/{layer/stacUtil.d.ts → util.d.ts} +18 -5
- package/util.d.ts.map +1 -0
- package/{layer/stacUtil.js → util.js} +27 -8
- package/util.js.map +1 -0
- package/layer/stacUtil.d.ts.map +0 -1
- package/layer/stacUtil.js.map +0 -1
- package/source/GeoTIFF2.d.ts +0 -35
- package/source/GeoTIFF2.d.ts.map +0 -1
- package/source/GeoTIFF2.js +0 -40
- package/source/GeoTIFF2.js.map +0 -1
package/README.md
CHANGED
|
@@ -2,31 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
An "automagical" STAC LayerGroup for OpenLayers released under the [Apache 2.0 license](LICENSE.md).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+

|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Getting Started
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
```
|
|
9
|
+
Please read the Quick Start first:
|
|
10
|
+
<https://m-mohr.github.io/ol-stac/doc/quickstart.html>
|
|
12
11
|
|
|
13
|
-
Explore the examples to get started with some code:
|
|
12
|
+
Explore the examples to get started with some more code:
|
|
14
13
|
<https://m-mohr.github.io/ol-stac/en/latest/examples/>
|
|
15
14
|
|
|
15
|
+
Dig into the API documentation for all details:
|
|
16
|
+
<https://m-mohr.github.io/ol-stac/en/latest/apidoc/>
|
|
17
|
+
|
|
18
|
+
**ol-stac requires OpenLayers version >=7.5.2**
|
|
16
19
|
|
|
17
20
|
## Sponsors
|
|
18
21
|
|
|
19
22
|
ol-stac appreciates contributions of all kinds.
|
|
20
23
|
|
|
21
24
|
The development of this package was financially supported by:
|
|
22
|
-
- Planet Labs PBC
|
|
23
|
-
- EOX IT Services GmbH
|
|
25
|
+
- [Planet Labs PBC](https://planet.com)
|
|
26
|
+
- [EOX IT Services GmbH](https://eox.at)
|
|
24
27
|
|
|
25
28
|
Many thanks also to OpenLayers and its contributors.
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
[stac-layer](https://github.com/stac-utils/stac-layer).
|
|
29
|
-
It has a very similar interface and functionality.
|
|
30
|
+
[If you need any help, please contact me.](https://mohr.ws)
|
|
30
31
|
|
|
31
32
|
## TypeScript support
|
|
32
33
|
|
|
@@ -40,4 +41,8 @@ Check out the [hosted examples](https://m-mohr.github.io/ol-stac/en/latest/examp
|
|
|
40
41
|
|
|
41
42
|
Please use the [GitHub issue tracker](https://github.com/m-mohr/ol-stac/issues) for all bugs and feature requests. Before creating a new issue, do a quick search to see if the problem has been reported already.
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
## Related work
|
|
45
|
+
|
|
46
|
+
A similar package for Leaflet and authored by Daniel Dufour and Matthias Mohr is
|
|
47
|
+
[stac-layer](https://github.com/stac-utils/stac-layer).
|
|
48
|
+
It has a very similar interface and functionality.
|
package/events/ErrorEvent.d.ts
CHANGED
|
@@ -2,14 +2,17 @@ export default ErrorEvent;
|
|
|
2
2
|
/**
|
|
3
3
|
* @classdesc
|
|
4
4
|
* Event emitted on configuration or loading error.
|
|
5
|
+
* @api
|
|
5
6
|
*/
|
|
6
7
|
declare class ErrorEvent extends BaseEvent {
|
|
7
8
|
/**
|
|
8
9
|
* @param {Error} error error object.
|
|
10
|
+
* @api
|
|
9
11
|
*/
|
|
10
12
|
constructor(error: Error);
|
|
11
13
|
/**
|
|
12
14
|
* @type {Error}
|
|
15
|
+
* @api
|
|
13
16
|
*/
|
|
14
17
|
error: Error;
|
|
15
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorEvent.d.ts","sourceRoot":"","sources":["../../../src/ol/events/ErrorEvent.js"],"names":[],"mappings":";AAMA
|
|
1
|
+
{"version":3,"file":"ErrorEvent.d.ts","sourceRoot":"","sources":["../../../src/ol/events/ErrorEvent.js"],"names":[],"mappings":";AAMA;;;;GAIG;AACH;IACE;;;OAGG;IACH,mBAHW,KAAK,EAWf;IALC;;;OAGG;IACH,OAHU,KAAK,CAGG;CAErB;sBAtBqB,oBAAoB"}
|
package/events/ErrorEvent.js
CHANGED
|
@@ -6,15 +6,18 @@ import EventType from 'ol/events/EventType.js';
|
|
|
6
6
|
/**
|
|
7
7
|
* @classdesc
|
|
8
8
|
* Event emitted on configuration or loading error.
|
|
9
|
+
* @api
|
|
9
10
|
*/
|
|
10
11
|
class ErrorEvent extends BaseEvent {
|
|
11
12
|
/**
|
|
12
13
|
* @param {Error} error error object.
|
|
14
|
+
* @api
|
|
13
15
|
*/
|
|
14
16
|
constructor(error) {
|
|
15
17
|
super(EventType.ERROR);
|
|
16
18
|
/**
|
|
17
19
|
* @type {Error}
|
|
20
|
+
* @api
|
|
18
21
|
*/
|
|
19
22
|
this.error = error;
|
|
20
23
|
}
|
package/events/ErrorEvent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorEvent.js","sourceRoot":"","sources":["../../../src/ol/events/ErrorEvent.js"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAE/C
|
|
1
|
+
{"version":3,"file":"ErrorEvent.js","sourceRoot":"","sources":["../../../src/ol/events/ErrorEvent.js"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAE/C;;;;GAIG;AACH,MAAM,UAAW,SAAQ,SAAS;IAChC;;;OAGG;IACH,YAAY,KAAK;QACf,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAEvB;;;WAGG;QACH,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF;AAED,eAAe,UAAU,CAAC"}
|
package/layer/STAC.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
export default STACLayer;
|
|
2
2
|
export type Extent = import("ol/extent.js").Extent;
|
|
3
|
-
export type
|
|
4
|
-
export type ImageStaticSourceOptions = import("ol/source/ImageStatic.js").Options;
|
|
3
|
+
export type Layer = import("ol/layer.js").Layer;
|
|
5
4
|
export type Link = any;
|
|
6
|
-
export type STACObject = any;
|
|
7
5
|
export type Style = import('ol/style.js').Style;
|
|
8
|
-
export type
|
|
6
|
+
export type SourceOptions = import('../source/type.js').SourceOptions;
|
|
9
7
|
export type Options = {
|
|
10
8
|
/**
|
|
11
9
|
* The STAC URL. Any of `url` and `data` must be provided.
|
|
@@ -17,6 +15,11 @@ export type Options = {
|
|
|
17
15
|
* `data` take precedence over `url`.
|
|
18
16
|
*/
|
|
19
17
|
data?: STAC | Asset | any;
|
|
18
|
+
/**
|
|
19
|
+
* For STAC Catalogs and Collections, any child entites
|
|
20
|
+
* to show. Can be STAC ItemCollections (as ItemCollection, GeoJSON FeatureCollection, or URL) or a list of STAC entities.
|
|
21
|
+
*/
|
|
22
|
+
children?: ItemCollection | any | Array<STAC> | string | null;
|
|
20
23
|
/**
|
|
21
24
|
* The selector for the assets to be rendered,
|
|
22
25
|
* only for STAC Items and Collections.
|
|
@@ -29,23 +32,18 @@ export type Options = {
|
|
|
29
32
|
*/
|
|
30
33
|
bands?: number[] | undefined;
|
|
31
34
|
/**
|
|
32
|
-
* Optional function that can be used to configure the underlying
|
|
33
|
-
* and return the completed options or a promise for the same. The function will be called with the current source options
|
|
34
|
-
* and the STAC Asset.
|
|
35
|
-
*/
|
|
36
|
-
getGeoTIFFSourceOptions?: ((arg0: GeoTIFFSourceOptions, arg1: Asset) => (GeoTIFFSourceOptions | Promise<GeoTIFFSourceOptions>)) | undefined;
|
|
37
|
-
/**
|
|
38
|
-
* Optional function that can be used to configure the underlying ImageStatic sources. The function can do any additional work
|
|
35
|
+
* Optional function that can be used to configure the underlying sources. The function can do any additional work
|
|
39
36
|
* and return the completed options or a promise for the same. The function will be called with the current source options
|
|
40
37
|
* and the STAC Asset or Link.
|
|
38
|
+
* This can be useful for adding auth information such as an API token, either via query parameter or HTTP headers.
|
|
39
|
+
* Please be aware that sending HTTP headers may not be supported by all sources.
|
|
41
40
|
*/
|
|
42
|
-
|
|
41
|
+
getSourceOptions?: ((arg0: SourceType, arg1: SourceOptions, arg2: (Asset | Link)) => (SourceOptions | Promise<SourceOptions>)) | undefined;
|
|
43
42
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* source options and the STAC Asset or Link.
|
|
43
|
+
* Allows to hide the footprints (bounding box/geometry) of the STAC object
|
|
44
|
+
* by default.
|
|
47
45
|
*/
|
|
48
|
-
|
|
46
|
+
displayFootprint?: boolean | undefined;
|
|
49
47
|
/**
|
|
50
48
|
* Allow to choose non-cloud-optimized GeoTiffs as default image to show,
|
|
51
49
|
* which might not work well for larger files or larger amounts of files.
|
|
@@ -64,11 +62,14 @@ export type Options = {
|
|
|
64
62
|
*/
|
|
65
63
|
displayOverview?: boolean | undefined;
|
|
66
64
|
/**
|
|
67
|
-
* Allow to display a layer
|
|
68
|
-
*
|
|
69
|
-
*
|
|
65
|
+
* Allow to display a layer
|
|
66
|
+
* based on the information provided through the web map links extension.
|
|
67
|
+
* If an array of links or link ids (property `id` in a Link Object) is provided, all corresponding layers will be shown.
|
|
68
|
+
* If set to true or to a specific type of web map link (`pmtiles`, `tilejson`, `wms`, `wmts`, `xyz`),
|
|
69
|
+
* it lets this library choose a web map link to show, but only if no other data is shown.
|
|
70
|
+
* To disable the functionality set this to `false`.
|
|
70
71
|
*/
|
|
71
|
-
displayWebMapLink?: string | boolean | undefined;
|
|
72
|
+
displayWebMapLink?: string | boolean | any[] | undefined;
|
|
72
73
|
/**
|
|
73
74
|
* The style for the overall bounds / footprint.
|
|
74
75
|
*/
|
|
@@ -131,27 +132,27 @@ export type Options = {
|
|
|
131
132
|
* be visible.
|
|
132
133
|
*/
|
|
133
134
|
maxZoom?: number | undefined;
|
|
135
|
+
/**
|
|
136
|
+
* Arbitrary observable properties. Can be accessed with `#get()` and `#set()`. `stac` and `bounds` are reserved and may be overridden.
|
|
137
|
+
*/
|
|
138
|
+
properties?: {
|
|
139
|
+
[x: string]: any;
|
|
140
|
+
} | undefined;
|
|
134
141
|
};
|
|
135
142
|
/**
|
|
136
143
|
* @typedef {import("ol/extent.js").Extent} Extent
|
|
137
144
|
*/
|
|
138
145
|
/**
|
|
139
|
-
* @typedef {import("
|
|
140
|
-
*/
|
|
141
|
-
/**
|
|
142
|
-
* @typedef {import("ol/source/ImageStatic.js").Options} ImageStaticSourceOptions
|
|
146
|
+
* @typedef {import("ol/layer.js").Layer} Layer
|
|
143
147
|
*/
|
|
144
148
|
/**
|
|
145
149
|
* @typedef {import("stac-js").Link} Link
|
|
146
150
|
*/
|
|
147
|
-
/**
|
|
148
|
-
* @typedef {import("stac-js").STACObject} STACObject
|
|
149
|
-
*/
|
|
150
151
|
/**
|
|
151
152
|
* @typedef {import('ol/style.js').Style} Style
|
|
152
153
|
*/
|
|
153
154
|
/**
|
|
154
|
-
* @typedef {import(
|
|
155
|
+
* @typedef {import('../source/type.js').SourceOptions} SourceOptions
|
|
155
156
|
*/
|
|
156
157
|
/**
|
|
157
158
|
* @typedef {Object} Options
|
|
@@ -159,23 +160,21 @@ export type Options = {
|
|
|
159
160
|
* Can also be used as url for data, if it is absolute and doesn't contain a self link.
|
|
160
161
|
* @property {STAC|Asset|Object} [data] The STAC metadata. Any of `url` and `data` must be provided.
|
|
161
162
|
* `data` take precedence over `url`.
|
|
163
|
+
* @property {ItemCollection|Object|Array<STAC>|string|null} [children=null] For STAC Catalogs and Collections, any child entites
|
|
164
|
+
* to show. Can be STAC ItemCollections (as ItemCollection, GeoJSON FeatureCollection, or URL) or a list of STAC entities.
|
|
162
165
|
* @property {Array<string|Asset>|null} [assets=null] The selector for the assets to be rendered,
|
|
163
166
|
* only for STAC Items and Collections.
|
|
164
167
|
* This can be an array of strings corresponding to asset keys or Asset objects.
|
|
165
168
|
* null shows the default asset, an empty array shows no asset.
|
|
166
169
|
* @property {Array<number>} [bands] The (one-based) bands to show.
|
|
167
|
-
* @property {function(
|
|
168
|
-
* Optional function that can be used to configure the underlying
|
|
169
|
-
* and return the completed options or a promise for the same. The function will be called with the current source options
|
|
170
|
-
* and the STAC Asset.
|
|
171
|
-
* @property {function(ImageStaticSourceOptions, (Asset|Link)):(ImageStaticSourceOptions|Promise<ImageStaticSourceOptions>)} [getImageStaticSourceOptions]
|
|
172
|
-
* Optional function that can be used to configure the underlying ImageStatic sources. The function can do any additional work
|
|
170
|
+
* @property {function(SourceType, SourceOptions, (Asset|Link)):(SourceOptions|Promise<SourceOptions>)} [getSourceOptions]
|
|
171
|
+
* Optional function that can be used to configure the underlying sources. The function can do any additional work
|
|
173
172
|
* and return the completed options or a promise for the same. The function will be called with the current source options
|
|
174
173
|
* and the STAC Asset or Link.
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
174
|
+
* This can be useful for adding auth information such as an API token, either via query parameter or HTTP headers.
|
|
175
|
+
* Please be aware that sending HTTP headers may not be supported by all sources.
|
|
176
|
+
* @property {boolean} [displayFootprint=true] Allows to hide the footprints (bounding box/geometry) of the STAC object
|
|
177
|
+
* by default.
|
|
179
178
|
* @property {boolean} [displayGeoTiffByDefault=false] Allow to choose non-cloud-optimized GeoTiffs as default image to show,
|
|
180
179
|
* which might not work well for larger files or larger amounts of files.
|
|
181
180
|
* @property {boolean} [displayPreview=false] Allow to display images that a browser can display (e.g. PNG, JPEG),
|
|
@@ -184,9 +183,12 @@ export type Options = {
|
|
|
184
183
|
* For performance reasons, it is recommended to enable this option if you pass in STAC API Items.
|
|
185
184
|
* @property {boolean} [displayOverview=true] Allow to display COGs and, if `displayGeoTiffByDefault` is enabled, GeoTiffs,
|
|
186
185
|
* usually the assets with role `overview` or `visual`.
|
|
187
|
-
* @property {string|boolean} [displayWebMapLink=false] Allow to display a layer
|
|
188
|
-
*
|
|
189
|
-
*
|
|
186
|
+
* @property {string|boolean|Array<Link|string>} [displayWebMapLink=false] Allow to display a layer
|
|
187
|
+
* based on the information provided through the web map links extension.
|
|
188
|
+
* If an array of links or link ids (property `id` in a Link Object) is provided, all corresponding layers will be shown.
|
|
189
|
+
* If set to true or to a specific type of web map link (`pmtiles`, `tilejson`, `wms`, `wmts`, `xyz`),
|
|
190
|
+
* it lets this library choose a web map link to show, but only if no other data is shown.
|
|
191
|
+
* To disable the functionality set this to `false`.
|
|
190
192
|
* @property {Style} [boundsStyle] The style for the overall bounds / footprint.
|
|
191
193
|
* @property {Style} [collectionStyle] The style for individual items in a list of STAC Items or Collections.
|
|
192
194
|
* @property {null|string} [crossOrigin] For thumbnails: The `crossOrigin` attribute for loaded images / tiles.
|
|
@@ -210,6 +212,7 @@ export type Options = {
|
|
|
210
212
|
* visible.
|
|
211
213
|
* @property {number} [maxZoom] The maximum view zoom level (inclusive) at which this layer will
|
|
212
214
|
* be visible.
|
|
215
|
+
* @property {Object<string, *>} [properties] Arbitrary observable properties. Can be accessed with `#get()` and `#set()`. `stac` and `bounds` are reserved and may be overridden.
|
|
213
216
|
*/
|
|
214
217
|
/**
|
|
215
218
|
* @classdesc
|
|
@@ -225,30 +228,26 @@ export type Options = {
|
|
|
225
228
|
declare class STACLayer extends LayerGroup {
|
|
226
229
|
/**
|
|
227
230
|
* @param {Options} options Layer options.
|
|
231
|
+
* @api
|
|
228
232
|
*/
|
|
229
233
|
constructor(options: Options);
|
|
230
234
|
/**
|
|
231
|
-
* @type {function(
|
|
235
|
+
* @type {function(SourceType, SourceOptions, (Asset|Link)):(SourceOptions|Promise<SourceOptions>)}
|
|
232
236
|
* @private
|
|
233
237
|
*/
|
|
234
|
-
private
|
|
238
|
+
private getSourceOptions_;
|
|
235
239
|
/**
|
|
236
|
-
* @type {
|
|
240
|
+
* @type {STAC|Asset}
|
|
237
241
|
* @private
|
|
238
242
|
*/
|
|
239
|
-
private
|
|
243
|
+
private data_;
|
|
240
244
|
/**
|
|
241
|
-
* @type {
|
|
245
|
+
* @type {Array<STAC>|null}
|
|
242
246
|
* @private
|
|
243
247
|
*/
|
|
244
|
-
private
|
|
248
|
+
private children_;
|
|
245
249
|
/**
|
|
246
|
-
* @type {
|
|
247
|
-
* @private
|
|
248
|
-
*/
|
|
249
|
-
private data_;
|
|
250
|
-
/**
|
|
251
|
-
* @type {Array<Asset> | null}
|
|
250
|
+
* @type {Array<Asset>|null}
|
|
252
251
|
* @private
|
|
253
252
|
*/
|
|
254
253
|
private assets_;
|
|
@@ -258,10 +257,15 @@ declare class STACLayer extends LayerGroup {
|
|
|
258
257
|
*/
|
|
259
258
|
private bands_;
|
|
260
259
|
/**
|
|
261
|
-
* @type {string
|
|
260
|
+
* @type {string|null}
|
|
262
261
|
* @private
|
|
263
262
|
*/
|
|
264
263
|
private crossOrigin_;
|
|
264
|
+
/**
|
|
265
|
+
* @type {boolean}
|
|
266
|
+
* @private
|
|
267
|
+
*/
|
|
268
|
+
private displayFootprint_;
|
|
265
269
|
/**
|
|
266
270
|
* @type {boolean}
|
|
267
271
|
* @private
|
|
@@ -278,9 +282,9 @@ declare class STACLayer extends LayerGroup {
|
|
|
278
282
|
*/
|
|
279
283
|
private displayOverview_;
|
|
280
284
|
/**
|
|
281
|
-
* @type {string|boolean}
|
|
285
|
+
* @type {string|boolean|Array<Link|string>}
|
|
282
286
|
*/
|
|
283
|
-
displayWebMapLink_: string | boolean
|
|
287
|
+
displayWebMapLink_: string | boolean | Array<Link | string>;
|
|
284
288
|
/**
|
|
285
289
|
* @type {function(Asset):string|null}
|
|
286
290
|
* @private
|
|
@@ -309,8 +313,9 @@ declare class STACLayer extends LayerGroup {
|
|
|
309
313
|
/**
|
|
310
314
|
* Returns the vector layer that visualizes the bounds / footprint.
|
|
311
315
|
* @return {VectorLayer|null} The vector layer for the bounds
|
|
316
|
+
* @api
|
|
312
317
|
*/
|
|
313
|
-
getBoundsLayer(): VectorLayer
|
|
318
|
+
getBoundsLayer(): VectorLayer | null;
|
|
314
319
|
/**
|
|
315
320
|
* @private
|
|
316
321
|
* @param {Error} error The error.
|
|
@@ -320,15 +325,17 @@ declare class STACLayer extends LayerGroup {
|
|
|
320
325
|
* @private
|
|
321
326
|
* @param {STAC|Asset|Object} data The STAC data.
|
|
322
327
|
* @param {string} url The url to the data.
|
|
323
|
-
* @param {Array<
|
|
328
|
+
* @param {ItemCollection|Object|Array<STAC>|string|null} children The child STAC entities to show.
|
|
329
|
+
* @param {Array<Asset|string>|null} assets The assets to show.
|
|
324
330
|
* @param {Array<number>} bands The (one-based) bands to show.
|
|
325
331
|
*/
|
|
326
332
|
private configure_;
|
|
327
333
|
/**
|
|
328
334
|
* @private
|
|
335
|
+
* @param {Array<STAC>} collection The list of STAC entities to show.
|
|
329
336
|
* @return {Promise} Resolves when complete.
|
|
330
337
|
*/
|
|
331
|
-
private
|
|
338
|
+
private addChildren_;
|
|
332
339
|
/**
|
|
333
340
|
* @private
|
|
334
341
|
* @return {Promise} Resolves when complete.
|
|
@@ -348,17 +355,18 @@ declare class STACLayer extends LayerGroup {
|
|
|
348
355
|
private addThumbnail_;
|
|
349
356
|
/**
|
|
350
357
|
* Adds a layer for the web map links available in the STAC links.
|
|
351
|
-
* @return {Promise<Array<
|
|
358
|
+
* @return {Promise<Array<Layer>|undefined>} Resolves with a Layer or undefined when complete.
|
|
352
359
|
*/
|
|
353
|
-
addWebMapLinks_(): Promise<Array<
|
|
360
|
+
addWebMapLinks_(): Promise<Array<Layer> | undefined>;
|
|
354
361
|
/**
|
|
355
362
|
* Adds a layer for a link that implements the web-map-links extension.
|
|
356
|
-
* Supports: TileJSON, WMS, WMTS, XYZ
|
|
363
|
+
* Supports: PMTiles, TileJSON, WMS, WMTS, XYZ
|
|
357
364
|
* @see https://github.com/stac-extensions/web-map-links
|
|
358
365
|
* @param {Link} link A web map link
|
|
359
|
-
* @return {Promise<Array<
|
|
366
|
+
* @return {Promise<Array<Layer>|undefined>} Resolves with a list of layers or undefined when complete.
|
|
367
|
+
* @api
|
|
360
368
|
*/
|
|
361
|
-
addLayerForLink(link: any): Promise<Array<
|
|
369
|
+
addLayerForLink(link: any): Promise<Array<Layer> | undefined>;
|
|
362
370
|
/**
|
|
363
371
|
* @private
|
|
364
372
|
* @param {Asset} [asset] A STAC Asset
|
|
@@ -373,7 +381,7 @@ declare class STACLayer extends LayerGroup {
|
|
|
373
381
|
private addTileLayerForImagery_;
|
|
374
382
|
/**
|
|
375
383
|
* @param {Layer|LayerGroup} [layer] A Layer to add to the LayerGroup
|
|
376
|
-
* @param {STACObject} [data] The STAC object, can be any class exposed by stac-js
|
|
384
|
+
* @param {import("stac-js").STACObject} [data] The STAC object, can be any class exposed by stac-js
|
|
377
385
|
* @param {number} [zIndex=0] The z-index for the layer
|
|
378
386
|
* @private
|
|
379
387
|
*/
|
|
@@ -390,33 +398,64 @@ declare class STACLayer extends LayerGroup {
|
|
|
390
398
|
/**
|
|
391
399
|
* Indicates whether the LayerGroup shows only the bounds layer (i.e. no imagery/tile layers).
|
|
392
400
|
* @return {boolean} `true` if only the bounds layer is shown, `false` otherwise.
|
|
401
|
+
* @api
|
|
393
402
|
*/
|
|
394
403
|
hasOnlyBounds(): boolean;
|
|
395
404
|
/**
|
|
396
405
|
* Returns all potential web map links based on the given value for `displayWebMapLink`.
|
|
397
406
|
* @return {Array<Link>} An array of links.
|
|
407
|
+
* @api
|
|
398
408
|
*/
|
|
399
409
|
getWebMapLinks(): Array<Link>;
|
|
400
410
|
/**
|
|
401
411
|
* Update the assets to be rendered.
|
|
402
412
|
* @param {Array<string|Asset>|null} assets The assets to show.
|
|
403
413
|
* @return {Promise} Resolves when all assets are rendered.
|
|
414
|
+
* @api
|
|
404
415
|
*/
|
|
405
416
|
setAssets(assets: Array<string | Asset> | null): Promise<any>;
|
|
417
|
+
/**
|
|
418
|
+
* Updates the children STAC entities to be rendered.
|
|
419
|
+
* @param {ItemCollection|Object|Array<STAC>|string|null} childs The children to show.
|
|
420
|
+
* @return {Promise} Resolves when all items are rendered.
|
|
421
|
+
* @api
|
|
422
|
+
*/
|
|
423
|
+
setChildren(childs: ItemCollection | any | Array<STAC> | string | null): Promise<any>;
|
|
406
424
|
/**
|
|
407
425
|
* Get the STAC object.
|
|
408
426
|
*
|
|
409
427
|
* @return {STAC|Asset} The STAC object.
|
|
428
|
+
* @api
|
|
410
429
|
*/
|
|
411
430
|
getData(): STAC | Asset;
|
|
431
|
+
/**
|
|
432
|
+
* Get the children STAC entities.
|
|
433
|
+
*
|
|
434
|
+
* @return {STAC} The STAC child entities.
|
|
435
|
+
* @api
|
|
436
|
+
*/
|
|
437
|
+
getChildren(): STAC;
|
|
412
438
|
/**
|
|
413
439
|
* Get the STAC assets shown.
|
|
414
440
|
*
|
|
415
441
|
* @return {Array<Asset>} The STAC assets.
|
|
442
|
+
* @api
|
|
416
443
|
*/
|
|
417
444
|
getAssets(): Array<Asset>;
|
|
445
|
+
/**
|
|
446
|
+
* Get the attributions of the STAC entity assigned to this layer.
|
|
447
|
+
*
|
|
448
|
+
* @return {Array<string>} Attributions for this layer.
|
|
449
|
+
* @api
|
|
450
|
+
*/
|
|
451
|
+
getAttributions(): Array<string>;
|
|
452
|
+
/**
|
|
453
|
+
* Get the layer source.
|
|
454
|
+
* @return {SourceType|null} The layer source (or `null` if not yet set).
|
|
455
|
+
*/
|
|
456
|
+
getSource(): SourceType | null;
|
|
418
457
|
}
|
|
458
|
+
import SourceType from '../source/type.js';
|
|
419
459
|
import LayerGroup from 'ol/layer/Group.js';
|
|
420
460
|
import VectorLayer from 'ol/layer/Vector.js';
|
|
421
|
-
import TileLayer from 'ol/layer/Tile.js';
|
|
422
461
|
//# sourceMappingURL=STAC.d.ts.map
|
package/layer/STAC.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"STAC.d.ts","sourceRoot":"","sources":["../../../src/ol/layer/STAC.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"STAC.d.ts","sourceRoot":"","sources":["../../../src/ol/layer/STAC.js"],"names":[],"mappings":";qBAoCa,OAAO,cAAc,EAAE,MAAM;oBAG7B,OAAO,aAAa,EAAE,KAAK;;oBAM3B,OAAO,aAAa,EAAE,KAAK;4BAG3B,OAAO,mBAAmB,EAAE,aAAa;;;;;;;;;;;WAOxC,kBAAiB;;;;;eAEjB,uBAAsB,WAAW,GAAC,MAAM,GAAC,IAAI;;;;;;;;;;;;;;;;;;;+BAOpC,UAAU,QAAE,aAAa,QAAE,CAAC,QAAM,IAAI,CAAC,KAAE,CAAC,aAAa,GAAC,QAAQ,aAAa,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6CA0BxE,MAAM,GAAC,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAvDzC;;GAEG;AACH;;GAEG;AACH;;GAEG;AACH;;GAEG;AACH;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AAEH;;;;;;;;;;GAUG;AACH;IACE;;;OAGG;IACH,qBAHW,OAAO,EAgJjB;IA9HC;;;OAGG;IACH,0BAAiD;IAEjD;;;OAGG;IACH,cAAU;IAEV;;;OAGG;IACH,kBAAqB;IAErB;;;OAGG;IACH,gBAAmB;IAEnB;;;OAGG;IACH,eAAgB;IAEhB;;;OAGG;IACH,qBAA+C;IAE/C;;;OAGG;IACH,0BAA0E;IAE1E;;;OAGG;IACH,iCAAwE;IAExE;;;OAGG;IACH,wBAAsD;IAEtD;;;OAGG;IACH,yBAAwE;IAExE;;OAEG;IACH,oBAFU,MAAM,GAAC,OAAO,GAAC,MAAM,IAAI,GAAC,MAAM,CAAC,CAEiB;IAE5D;;;OAGG;IACH,8BAAiE;IAEjE;;;OAGG;IACH,gCAAsE;IAEtE;;;OAGG;IACH,qBAA6D;IAE7D;;;OAGG;IACH,yBAAyE;IAEzE;;;OAGG;IACH,qBAAwB;IAmC1B;;;;OAIG;IACH,kBAHY,WAAW,GAAC,IAAI,CAK3B;IAED;;;OAGG;IACH,qBASC;IAED;;;;;;;OAOG;IACH,mBAkDC;IAED;;;;OAIG;IACH,qBAeC;IAED;;;OAGG;IACH,uBA0BC;IAED;;;;OAIG;IACH,oBAUC;IAED;;;;OAIG;IACH,sBA0BC;IAED;;;OAGG;IACH,mBAFY,QAAQ,MAAM,KAAK,CAAC,GAAC,SAAS,CAAC,CAO1C;IAED;;;;;;;OAOG;IACH,4BAHY,QAAQ,MAAM,KAAK,CAAC,GAAC,SAAS,CAAC,CAuI1C;IAED;;;;OAIG;IACH,oBA+DC;IAED;;;;OAIG;IACH,gCAgBC;IAED;;;;;OAKG;IACH,kBAIC;IAED;;;OAGG;IACH,sBA+BC;IAED;;OAEG;IACH,sBA4BC;IAED;;;;OAIG;IACH,iBAHY,OAAO,CASlB;IAED;;;;OAIG;IACH,kBAHY,MAAM,IAAI,CAAC,CA+BtB;IAED;;;;;OAKG;IACH,kBAJW,MAAM,MAAM,QAAM,CAAC,GAAC,IAAI,gBAmBlC;IAED;;;;;OAKG;IACH,oBAJW,uBAAsB,WAAW,GAAC,MAAM,GAAC,IAAI,gBAiCvD;IAED;;;;;OAKG;IACH,WAHY,YAAU,CAKrB;IAED;;;;;OAKG;IACH,oBAEC;IAED;;;;;OAKG;IACH,aAHY,YAAY,CAKvB;IAqCD;;;;;OAKG;IACH,mBAHY,MAAM,MAAM,CAAC,CAaxB;IAED;;;OAGG;IACH,aAFY,UAAU,GAAC,IAAI,CAI1B;CACF;uBAh9BsB,mBAAmB;uBADnB,mBAAmB;wBAKlB,oBAAoB"}
|