ol-stac 0.0.0 → 1.0.0-beta.1

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.
Files changed (120) hide show
  1. package/README.md +1 -1
  2. package/events/ErrorEvent.d.ts +17 -0
  3. package/events/ErrorEvent.d.ts.map +1 -0
  4. package/{src/ol/events → events}/ErrorEvent.js +9 -11
  5. package/events/ErrorEvent.js.map +1 -0
  6. package/layer/STAC.d.ts +422 -0
  7. package/layer/STAC.d.ts.map +1 -0
  8. package/layer/STAC.js +698 -0
  9. package/layer/STAC.js.map +1 -0
  10. package/layer/stacUtil.d.ts +46 -0
  11. package/layer/stacUtil.d.ts.map +1 -0
  12. package/layer/stacUtil.js +154 -0
  13. package/layer/stacUtil.js.map +1 -0
  14. package/package.json +3 -85
  15. package/source/GeoTIFF2.d.ts +35 -0
  16. package/source/GeoTIFF2.d.ts.map +1 -0
  17. package/{src/ol/source → source}/GeoTIFF2.js +9 -16
  18. package/source/GeoTIFF2.js.map +1 -0
  19. package/.eslintignore +0 -2
  20. package/.github/workflows/deploy.yml +0 -67
  21. package/.github/workflows/publish.yml +0 -32
  22. package/.github/workflows/release.yml +0 -21
  23. package/.github/workflows/test.yml +0 -85
  24. package/CHANGELOG.md +0 -14
  25. package/DEVELOPING.md +0 -104
  26. package/config/jsdoc/api/conf.json +0 -38
  27. package/config/jsdoc/api/index.md +0 -1
  28. package/config/jsdoc/api/readme.md +0 -65
  29. package/config/jsdoc/api/template/README.md +0 -3
  30. package/config/jsdoc/api/template/publish.js +0 -743
  31. package/config/jsdoc/api/template/static/scripts/linenumber.js +0 -11
  32. package/config/jsdoc/api/template/static/scripts/main.js +0 -305
  33. package/config/jsdoc/api/template/static/scripts/prettify/Apache-License-2.0.txt +0 -202
  34. package/config/jsdoc/api/template/static/scripts/prettify/lang-css.js +0 -2
  35. package/config/jsdoc/api/template/static/scripts/prettify/prettify.js +0 -28
  36. package/config/jsdoc/api/template/static/styles/carbon.css +0 -65
  37. package/config/jsdoc/api/template/static/styles/jaguar.css +0 -512
  38. package/config/jsdoc/api/template/static/styles/prettify-jsdoc.css +0 -111
  39. package/config/jsdoc/api/template/static/styles/prettify-tomorrow.css +0 -132
  40. package/config/jsdoc/api/template/static/theme +0 -1
  41. package/config/jsdoc/api/template/tmpl/container.tmpl +0 -205
  42. package/config/jsdoc/api/template/tmpl/details.tmpl +0 -84
  43. package/config/jsdoc/api/template/tmpl/example.tmpl +0 -2
  44. package/config/jsdoc/api/template/tmpl/examples.tmpl +0 -16
  45. package/config/jsdoc/api/template/tmpl/exceptions.tmpl +0 -30
  46. package/config/jsdoc/api/template/tmpl/layout.tmpl +0 -92
  47. package/config/jsdoc/api/template/tmpl/mainpage.tmpl +0 -14
  48. package/config/jsdoc/api/template/tmpl/members.tmpl +0 -38
  49. package/config/jsdoc/api/template/tmpl/method.tmpl +0 -132
  50. package/config/jsdoc/api/template/tmpl/navigation.tmpl +0 -59
  51. package/config/jsdoc/api/template/tmpl/observables.tmpl +0 -39
  52. package/config/jsdoc/api/template/tmpl/params.tmpl +0 -109
  53. package/config/jsdoc/api/template/tmpl/properties.tmpl +0 -85
  54. package/config/jsdoc/api/template/tmpl/returns.tmpl +0 -72
  55. package/config/jsdoc/api/template/tmpl/source.tmpl +0 -8
  56. package/config/jsdoc/api/template/tmpl/stability.tmpl +0 -7
  57. package/config/jsdoc/api/template/tmpl/tutorial.tmpl +0 -19
  58. package/config/jsdoc/api/template/tmpl/type.tmpl +0 -7
  59. package/config/jsdoc/info/conf.json +0 -22
  60. package/config/jsdoc/info/publish.js +0 -175
  61. package/config/jsdoc/package.json +0 -4
  62. package/config/jsdoc/plugins/api.cjs +0 -181
  63. package/config/jsdoc/plugins/default-export.cjs +0 -35
  64. package/config/jsdoc/plugins/define-plugin.cjs +0 -33
  65. package/config/jsdoc/plugins/events.cjs +0 -39
  66. package/config/jsdoc/plugins/inline-options.cjs +0 -102
  67. package/config/jsdoc/plugins/markdown.cjs +0 -119
  68. package/config/jsdoc/plugins/observable.cjs +0 -69
  69. package/config/jsdoc/plugins/virtual-plugin.cjs +0 -16
  70. package/config/rollup-full-build.js +0 -24
  71. package/config/tsconfig-build.json +0 -25
  72. package/examples/.eslintrc +0 -29
  73. package/examples/index.html +0 -100
  74. package/examples/index.js +0 -109
  75. package/examples/planetary-computer.html +0 -14
  76. package/examples/planetary-computer.js +0 -53
  77. package/examples/resources/Jugl.js +0 -15
  78. package/examples/resources/common.js +0 -111
  79. package/examples/stac-collection-webmaplinks.html +0 -9
  80. package/examples/stac-collection-webmaplinks.js +0 -55
  81. package/examples/stac-item-from-object.html +0 -9
  82. package/examples/stac-item-from-object.js +0 -102
  83. package/examples/stac-item-tileserver.html +0 -9
  84. package/examples/stac-item-tileserver.js +0 -34
  85. package/examples/stac-item.html +0 -9
  86. package/examples/stac-item.js +0 -45
  87. package/examples/stac-itemcollection.html +0 -11
  88. package/examples/stac-itemcollection.js +0 -39
  89. package/examples/templates/example.html +0 -206
  90. package/examples/templates/readme.md +0 -3
  91. package/examples/webpack/config.mjs +0 -69
  92. package/examples/webpack/example-builder.js +0 -410
  93. package/site/build.js +0 -26
  94. package/site/layouts/default.hbs +0 -78
  95. package/site/src/doc/faq.md +0 -8
  96. package/site/src/doc/index.md +0 -22
  97. package/site/src/doc/quickstart.md +0 -121
  98. package/site/src/doc/tutorials/index.md +0 -8
  99. package/site/src/download/index.hbs +0 -62
  100. package/site/src/favicon.ico +0 -0
  101. package/site/src/index.hbs +0 -71
  102. package/site/src/theme/index.css +0 -26
  103. package/site/src/theme/site.css +0 -531
  104. package/src/ol/layer/STAC.js +0 -780
  105. package/src/ol/layer/stacUtil.js +0 -169
  106. package/tasks/.eslintrc +0 -5
  107. package/tasks/build-website.sh +0 -90
  108. package/tasks/create-release.js +0 -107
  109. package/tasks/generate-index.js +0 -125
  110. package/tasks/generate-info.js +0 -189
  111. package/tasks/get-latest-release.js +0 -36
  112. package/tasks/newest-tag.js +0 -52
  113. package/tasks/prepare-package.js +0 -46
  114. package/tasks/publish.sh +0 -90
  115. package/test/README.md +0 -56
  116. package/test/browser/.eslintrc +0 -14
  117. package/test/browser/karma.config.cjs +0 -94
  118. package/test/browser/spec/ol/layer/STAC.test.js +0 -18
  119. package/test/browser/test-extensions.js +0 -419
  120. package/tsconfig.json +0 -62
package/README.md CHANGED
@@ -34,7 +34,7 @@ The [ol-stac package](https://npmjs.com/package/ol-stac) includes auto-generated
34
34
 
35
35
  ## Documentation
36
36
 
37
- Check out the [hosted examples](https://m-mohr.github.io/ol-stac/en/latest/examples/), the [workshop](https://m-mohr.github.io/ol-stac/workshop/) or the [API documentation](https://m-mohr.github.io/ol-stac/en/latest/apidoc/).
37
+ Check out the [hosted examples](https://m-mohr.github.io/ol-stac/en/latest/examples/) or the [API documentation](https://m-mohr.github.io/ol-stac/en/latest/apidoc/).
38
38
 
39
39
  ## Bugs
40
40
 
@@ -0,0 +1,17 @@
1
+ export default ErrorEvent;
2
+ /**
3
+ * @classdesc
4
+ * Event emitted on configuration or loading error.
5
+ */
6
+ declare class ErrorEvent extends BaseEvent {
7
+ /**
8
+ * @param {Error} error error object.
9
+ */
10
+ constructor(error: Error);
11
+ /**
12
+ * @type {Error}
13
+ */
14
+ error: Error;
15
+ }
16
+ import BaseEvent from 'ol/events/Event.js';
17
+ //# sourceMappingURL=ErrorEvent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorEvent.d.ts","sourceRoot":"","sources":["../../../src/ol/events/ErrorEvent.js"],"names":[],"mappings":";AAMA;;;GAGG;AACH;IACE;;OAEG;IACH,mBAFW,KAAK,EASf;IAJC;;OAEG;IACH,OAFU,KAAK,CAEG;CAErB;sBAnBqB,oBAAoB"}
@@ -3,23 +3,21 @@
3
3
  */
4
4
  import BaseEvent from 'ol/events/Event.js';
5
5
  import EventType from 'ol/events/EventType.js';
6
-
7
6
  /**
8
7
  * @classdesc
9
8
  * Event emitted on configuration or loading error.
10
9
  */
11
10
  class ErrorEvent extends BaseEvent {
12
- /**
13
- * @param {Error} error error object.
14
- */
15
- constructor(error) {
16
- super(EventType.ERROR);
17
-
18
11
  /**
19
- * @type {Error}
12
+ * @param {Error} error error object.
20
13
  */
21
- this.error = error;
22
- }
14
+ constructor(error) {
15
+ super(EventType.ERROR);
16
+ /**
17
+ * @type {Error}
18
+ */
19
+ this.error = error;
20
+ }
23
21
  }
24
-
25
22
  export default ErrorEvent;
23
+ //# sourceMappingURL=ErrorEvent.js.map
@@ -0,0 +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;;;GAGG;AACH,MAAM,UAAW,SAAQ,SAAS;IAChC;;OAEG;IACH,YAAY,KAAK;QACf,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAEvB;;WAEG;QACH,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF;AAED,eAAe,UAAU,CAAC"}
@@ -0,0 +1,422 @@
1
+ export default STACLayer;
2
+ export type Extent = import("ol/extent.js").Extent;
3
+ export type GeoTIFFSourceOptions = import("../source/GeoTIFF2.js").Options2;
4
+ export type ImageStaticSourceOptions = import("ol/source/ImageStatic.js").Options;
5
+ export type Link = any;
6
+ export type STACObject = any;
7
+ export type Style = import('ol/style.js').Style;
8
+ export type XYZSourceOptions = import("ol/source/XYZ.js").Options;
9
+ export type Options = {
10
+ /**
11
+ * The STAC URL. Any of `url` and `data` must be provided.
12
+ * Can also be used as url for data, if it is absolute and doesn't contain a self link.
13
+ */
14
+ url?: string | undefined;
15
+ /**
16
+ * The STAC metadata. Any of `url` and `data` must be provided.
17
+ * `data` take precedence over `url`.
18
+ */
19
+ data?: STAC | Asset | any;
20
+ /**
21
+ * The selector for the assets to be rendered,
22
+ * only for STAC Items and Collections.
23
+ * This can be an array of strings corresponding to asset keys or Asset objects.
24
+ * null shows the default asset, an empty array shows no asset.
25
+ */
26
+ assets?: any[] | null | undefined;
27
+ /**
28
+ * The (one-based) bands to show.
29
+ */
30
+ bands?: number[] | undefined;
31
+ /**
32
+ * Optional function that can be used to configure the underlying GeoTIFF sources. The function can do any additional work
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
39
+ * and return the completed options or a promise for the same. The function will be called with the current source options
40
+ * and the STAC Asset or Link.
41
+ */
42
+ getImageStaticSourceOptions?: ((arg0: ImageStaticSourceOptions, arg1: (Asset | Link)) => (ImageStaticSourceOptions | Promise<ImageStaticSourceOptions>)) | undefined;
43
+ /**
44
+ * Optional function that can be used to configure the underlying XYZ sources that displays imagery. The function can do any
45
+ * additional work and return the completed options or a promise for the same. The function will be called with the current
46
+ * source options and the STAC Asset or Link.
47
+ */
48
+ getXYZSourceOptions?: ((arg0: XYZSourceOptions, arg1: (Asset | Link)) => (XYZSourceOptions | Promise<XYZSourceOptions>)) | undefined;
49
+ /**
50
+ * Allow to choose non-cloud-optimized GeoTiffs as default image to show,
51
+ * which might not work well for larger files or larger amounts of files.
52
+ */
53
+ displayGeoTiffByDefault?: boolean | undefined;
54
+ /**
55
+ * Allow to display images that a browser can display (e.g. PNG, JPEG),
56
+ * usually assets with role `thumbnail` or the link with relation type `preview`.
57
+ * The previews are usually not covering the full extents and as such may be placed incorrectly on the map.
58
+ * For performance reasons, it is recommended to enable this option if you pass in STAC API Items.
59
+ */
60
+ displayPreview?: boolean | undefined;
61
+ /**
62
+ * Allow to display COGs and, if `displayGeoTiffByDefault` is enabled, GeoTiffs,
63
+ * usually the assets with role `overview` or `visual`.
64
+ */
65
+ displayOverview?: boolean | undefined;
66
+ /**
67
+ * Allow to display a layer based on the information provided through the
68
+ * web map links extension. It is only used if no other data is shown. You can set a specific type of
69
+ * web map link (`tilejson`, `wms`, `wmts`, `xyz`), let OpenLayers choose (`true`) or disable the functionality (`false`).
70
+ */
71
+ displayWebMapLink?: string | boolean | undefined;
72
+ /**
73
+ * The style for the overall bounds / footprint.
74
+ */
75
+ boundsStyle?: import("ol/style/Style.js").default | undefined;
76
+ /**
77
+ * The style for individual items in a list of STAC Items or Collections.
78
+ */
79
+ collectionStyle?: import("ol/style/Style.js").default | undefined;
80
+ /**
81
+ * For thumbnails: The `crossOrigin` attribute for loaded images / tiles.
82
+ * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.
83
+ */
84
+ crossOrigin?: string | null | undefined;
85
+ /**
86
+ * A function that generates a URL template for a tile server (XYZ),
87
+ * which will be used instead of the client-side GeoTIFF rendering (except if `useTileLayerAsFallback` is `true`).
88
+ */
89
+ buildTileUrlTemplate?: ((arg0: Asset) => string | null) | undefined;
90
+ /**
91
+ * Uses the given URL template only when the client-side GeoTIFF rendering fails.
92
+ */
93
+ useTileLayerAsFallback?: boolean | undefined;
94
+ /**
95
+ * Opacity (0, 1).
96
+ */
97
+ opacity?: number | undefined;
98
+ /**
99
+ * Visibility.
100
+ */
101
+ visible?: boolean | undefined;
102
+ /**
103
+ * The bounding extent for layer rendering. The layer will not be
104
+ * rendered outside of this extent.
105
+ */
106
+ extent?: import("ol/extent.js").Extent | undefined;
107
+ /**
108
+ * The z-index for layer rendering. At rendering time, the layers
109
+ * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed
110
+ * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`
111
+ * method was used.
112
+ */
113
+ zIndex?: number | undefined;
114
+ /**
115
+ * The minimum resolution (inclusive) at which this layer will be
116
+ * visible.
117
+ */
118
+ minResolution?: number | undefined;
119
+ /**
120
+ * The maximum resolution (exclusive) below which this layer will
121
+ * be visible.
122
+ */
123
+ maxResolution?: number | undefined;
124
+ /**
125
+ * The minimum view zoom level (exclusive) above which this layer will be
126
+ * visible.
127
+ */
128
+ minZoom?: number | undefined;
129
+ /**
130
+ * The maximum view zoom level (inclusive) at which this layer will
131
+ * be visible.
132
+ */
133
+ maxZoom?: number | undefined;
134
+ };
135
+ /**
136
+ * @typedef {import("ol/extent.js").Extent} Extent
137
+ */
138
+ /**
139
+ * @typedef {import("../source/GeoTIFF2.js").Options2} GeoTIFFSourceOptions
140
+ */
141
+ /**
142
+ * @typedef {import("ol/source/ImageStatic.js").Options} ImageStaticSourceOptions
143
+ */
144
+ /**
145
+ * @typedef {import("stac-js").Link} Link
146
+ */
147
+ /**
148
+ * @typedef {import("stac-js").STACObject} STACObject
149
+ */
150
+ /**
151
+ * @typedef {import('ol/style.js').Style} Style
152
+ */
153
+ /**
154
+ * @typedef {import("ol/source/XYZ.js").Options} XYZSourceOptions
155
+ */
156
+ /**
157
+ * @typedef {Object} Options
158
+ * @property {string} [url] The STAC URL. Any of `url` and `data` must be provided.
159
+ * Can also be used as url for data, if it is absolute and doesn't contain a self link.
160
+ * @property {STAC|Asset|Object} [data] The STAC metadata. Any of `url` and `data` must be provided.
161
+ * `data` take precedence over `url`.
162
+ * @property {Array<string|Asset>|null} [assets=null] The selector for the assets to be rendered,
163
+ * only for STAC Items and Collections.
164
+ * This can be an array of strings corresponding to asset keys or Asset objects.
165
+ * null shows the default asset, an empty array shows no asset.
166
+ * @property {Array<number>} [bands] The (one-based) bands to show.
167
+ * @property {function(GeoTIFFSourceOptions, Asset):(GeoTIFFSourceOptions|Promise<GeoTIFFSourceOptions>)} [getGeoTIFFSourceOptions]
168
+ * Optional function that can be used to configure the underlying GeoTIFF sources. The function can do any additional work
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
173
+ * and return the completed options or a promise for the same. The function will be called with the current source options
174
+ * and the STAC Asset or Link.
175
+ * @property {function(XYZSourceOptions, (Asset|Link)):(XYZSourceOptions|Promise<XYZSourceOptions>)} [getXYZSourceOptions]
176
+ * Optional function that can be used to configure the underlying XYZ sources that displays imagery. The function can do any
177
+ * additional work and return the completed options or a promise for the same. The function will be called with the current
178
+ * source options and the STAC Asset or Link.
179
+ * @property {boolean} [displayGeoTiffByDefault=false] Allow to choose non-cloud-optimized GeoTiffs as default image to show,
180
+ * which might not work well for larger files or larger amounts of files.
181
+ * @property {boolean} [displayPreview=false] Allow to display images that a browser can display (e.g. PNG, JPEG),
182
+ * usually assets with role `thumbnail` or the link with relation type `preview`.
183
+ * The previews are usually not covering the full extents and as such may be placed incorrectly on the map.
184
+ * For performance reasons, it is recommended to enable this option if you pass in STAC API Items.
185
+ * @property {boolean} [displayOverview=true] Allow to display COGs and, if `displayGeoTiffByDefault` is enabled, GeoTiffs,
186
+ * usually the assets with role `overview` or `visual`.
187
+ * @property {string|boolean} [displayWebMapLink=false] Allow to display a layer based on the information provided through the
188
+ * web map links extension. It is only used if no other data is shown. You can set a specific type of
189
+ * web map link (`tilejson`, `wms`, `wmts`, `xyz`), let OpenLayers choose (`true`) or disable the functionality (`false`).
190
+ * @property {Style} [boundsStyle] The style for the overall bounds / footprint.
191
+ * @property {Style} [collectionStyle] The style for individual items in a list of STAC Items or Collections.
192
+ * @property {null|string} [crossOrigin] For thumbnails: The `crossOrigin` attribute for loaded images / tiles.
193
+ * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.
194
+ * @property {function(Asset):string|null} [buildTileUrlTemplate=null] A function that generates a URL template for a tile server (XYZ),
195
+ * which will be used instead of the client-side GeoTIFF rendering (except if `useTileLayerAsFallback` is `true`).
196
+ * @property {boolean} [useTileLayerAsFallback=false] Uses the given URL template only when the client-side GeoTIFF rendering fails.
197
+ * @property {number} [opacity=1] Opacity (0, 1).
198
+ * @property {boolean} [visible=true] Visibility.
199
+ * @property {Extent} [extent] The bounding extent for layer rendering. The layer will not be
200
+ * rendered outside of this extent.
201
+ * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers
202
+ * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed
203
+ * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`
204
+ * method was used.
205
+ * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be
206
+ * visible.
207
+ * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will
208
+ * be visible.
209
+ * @property {number} [minZoom] The minimum view zoom level (exclusive) above which this layer will be
210
+ * visible.
211
+ * @property {number} [maxZoom] The maximum view zoom level (inclusive) at which this layer will
212
+ * be visible.
213
+ */
214
+ /**
215
+ * @classdesc
216
+ * Renders STAC entities such as STAC Items, Collectons or lists of them as returned by APIs.
217
+ * The layers created by this LayerGroup all have a 'stac' value that can be retrieved using `layer.get('stac')`.
218
+ *
219
+ * @extends LayerGroup
220
+ * @fires sourceready
221
+ * @fires assetsready
222
+ * @fires ErorEvent#event:error
223
+ * @api
224
+ */
225
+ declare class STACLayer extends LayerGroup {
226
+ /**
227
+ * @param {Options} options Layer options.
228
+ */
229
+ constructor(options: Options);
230
+ /**
231
+ * @type {function(GeoTIFFSourceOptions, Asset):(GeoTIFFSourceOptions|Promise<GeoTIFFSourceOptions>)}
232
+ * @private
233
+ */
234
+ private getGeoTIFFSourceOptions_;
235
+ /**
236
+ * @type {function(ImageStaticSourceOptions, (Asset|Link)):(ImageStaticSourceOptions|Promise<ImageStaticSourceOptions>)}
237
+ * @private
238
+ */
239
+ private getImageStaticSourceOptions_;
240
+ /**
241
+ * @type {function(XYZSourceOptions, (Asset|Link)):(XYZSourceOptions|Promise<XYZSourceOptions>)}
242
+ * @private
243
+ */
244
+ private getXYZSourceOptions_;
245
+ /**
246
+ * @type {STAC|Asset}
247
+ * @private
248
+ */
249
+ private data_;
250
+ /**
251
+ * @type {Array<Asset> | null}
252
+ * @private
253
+ */
254
+ private assets_;
255
+ /**
256
+ * @type {Array<number>}
257
+ * @private
258
+ */
259
+ private bands_;
260
+ /**
261
+ * @type {string | null}
262
+ * @private
263
+ */
264
+ private crossOrigin_;
265
+ /**
266
+ * @type {boolean}
267
+ * @private
268
+ */
269
+ private displayGeoTiffByDefault_;
270
+ /**
271
+ * @type {boolean}
272
+ * @private
273
+ */
274
+ private displayPreview_;
275
+ /**
276
+ * @type {boolean}
277
+ * @private
278
+ */
279
+ private displayOverview_;
280
+ /**
281
+ * @type {string|boolean}
282
+ */
283
+ displayWebMapLink_: string | boolean;
284
+ /**
285
+ * @type {function(Asset):string|null}
286
+ * @private
287
+ */
288
+ private buildTileUrlTemplate_;
289
+ /**
290
+ * @type {boolean}
291
+ * @private
292
+ */
293
+ private useTileLayerAsFallback_;
294
+ /**
295
+ * @type {Style}
296
+ * @private
297
+ */
298
+ private boundsStyle_;
299
+ /**
300
+ * @type {Style}
301
+ * @private
302
+ */
303
+ private collectionStyle_;
304
+ /**
305
+ * @type {VectorLayer|null}
306
+ * @private
307
+ */
308
+ private boundsLayer_;
309
+ /**
310
+ * Returns the vector layer that visualizes the bounds / footprint.
311
+ * @return {VectorLayer|null} The vector layer for the bounds
312
+ */
313
+ getBoundsLayer(): VectorLayer<any> | null;
314
+ /**
315
+ * @private
316
+ * @param {Error} error The error.
317
+ */
318
+ private handleError_;
319
+ /**
320
+ * @private
321
+ * @param {STAC|Asset|Object} data The STAC data.
322
+ * @param {string} url The url to the data.
323
+ * @param {Array<Asset|string> | null} assets The assets to show.
324
+ * @param {Array<number>} bands The (one-based) bands to show.
325
+ */
326
+ private configure_;
327
+ /**
328
+ * @private
329
+ * @return {Promise} Resolves when complete.
330
+ */
331
+ private addApiCollection_;
332
+ /**
333
+ * @private
334
+ * @return {Promise} Resolves when complete.
335
+ */
336
+ private addStacAssets_;
337
+ /**
338
+ * @private
339
+ * @param {Asset|Link} [ref] A STAC Link or Asset
340
+ * @return {Promise<Layer|undefined>} Resolves with a Layer or undefined when complete.
341
+ */
342
+ private addImagery_;
343
+ /**
344
+ * @private
345
+ * @param {Asset|Link} [thumbnail] A STAC Link or Asset
346
+ * @return {Promise<ImageLayer|undefined>} Resolves with am ImageLayer or udnefined when complete.
347
+ */
348
+ private addThumbnail_;
349
+ /**
350
+ * Adds a layer for the web map links available in the STAC links.
351
+ * @return {Promise<Array<TileLayer>|undefined>} Resolves with a Layer or undefined when complete.
352
+ */
353
+ addWebMapLinks_(): Promise<Array<TileLayer<any>> | undefined>;
354
+ /**
355
+ * Adds a layer for a link that implements the web-map-links extension.
356
+ * Supports: TileJSON, WMS, WMTS, XYZ
357
+ * @see https://github.com/stac-extensions/web-map-links
358
+ * @param {Link} link A web map link
359
+ * @return {Promise<Array<TileLayer>|undefined>} Resolves with a list of layers or undefined when complete.
360
+ */
361
+ addLayerForLink(link: any): Promise<Array<TileLayer<any>> | undefined>;
362
+ /**
363
+ * @private
364
+ * @param {Asset} [asset] A STAC Asset
365
+ * @return {Promise<Layer|undefined>} Resolves with a Layer or undefined when complete.
366
+ */
367
+ private addGeoTiff_;
368
+ /**
369
+ * @private
370
+ * @param {Asset|Link} [data] A STAC Asset or Link
371
+ * @return {Promise<TileLayer>} Resolves with a TileLayer when complete.
372
+ */
373
+ private addTileLayerForImagery_;
374
+ /**
375
+ * @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
377
+ * @param {number} [zIndex=0] The z-index for the layer
378
+ * @private
379
+ */
380
+ private addLayer_;
381
+ /**
382
+ * @private
383
+ * @return {VectorLayer|null} The vector layer showing the geometry/bbox.
384
+ */
385
+ private addFootprint_;
386
+ /**
387
+ * @private
388
+ */
389
+ private updateLayers_;
390
+ /**
391
+ * Indicates whether the LayerGroup shows only the bounds layer (i.e. no imagery/tile layers).
392
+ * @return {boolean} `true` if only the bounds layer is shown, `false` otherwise.
393
+ */
394
+ hasOnlyBounds(): boolean;
395
+ /**
396
+ * Returns all potential web map links based on the given value for `displayWebMapLink`.
397
+ * @return {Array<Link>} An array of links.
398
+ */
399
+ getWebMapLinks(): Array<Link>;
400
+ /**
401
+ * Update the assets to be rendered.
402
+ * @param {Array<string|Asset>|null} assets The assets to show.
403
+ * @return {Promise} Resolves when all assets are rendered.
404
+ */
405
+ setAssets(assets: Array<string | Asset> | null): Promise<any>;
406
+ /**
407
+ * Get the STAC object.
408
+ *
409
+ * @return {STAC|Asset} The STAC object.
410
+ */
411
+ getData(): STAC | Asset;
412
+ /**
413
+ * Get the STAC assets shown.
414
+ *
415
+ * @return {Array<Asset>} The STAC assets.
416
+ */
417
+ getAssets(): Array<Asset>;
418
+ }
419
+ import LayerGroup from 'ol/layer/Group.js';
420
+ import VectorLayer from 'ol/layer/Vector.js';
421
+ import TileLayer from 'ol/layer/Tile.js';
422
+ //# sourceMappingURL=STAC.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"STAC.d.ts","sourceRoot":"","sources":["../../../src/ol/layer/STAC.js"],"names":[],"mappings":";qBAgCa,OAAO,cAAc,EAAE,MAAM;mCAG7B,OAAO,uBAAuB,EAAE,QAAQ;uCAGxC,OAAO,0BAA0B,EAAE,OAAO;;;oBAS1C,OAAO,aAAa,EAAE,KAAK;+BAG3B,OAAO,kBAAkB,EAAE,OAAO;;;;;;;;;;;WAOjC,kBAAiB;;;;;;;;;;;;;;;;;sCAOR,oBAAoB,kBAAS,CAAC,oBAAoB,GAAC,QAAQ,oBAAoB,CAAC,CAAC;;;;;;0CAIjF,wBAAwB,QAAE,CAAC,QAAM,IAAI,CAAC,KAAE,CAAC,wBAAwB,GAAC,QAAQ,wBAAwB,CAAC,CAAC;;;;;;kCAIpG,gBAAgB,QAAE,CAAC,QAAM,IAAI,CAAC,KAAE,CAAC,gBAAgB,GAAC,QAAQ,gBAAgB,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6CAmBrE,MAAM,GAAC,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA5DzC;;GAEG;AACH;;GAEG;AACH;;GAEG;AACH;;GAEG;AACH;;GAEG;AACH;;GAEG;AACH;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEH;;;;;;;;;;GAUG;AACH;IACE;;OAEG;IACH,qBAFW,OAAO,EAuIjB;IAvHC;;;OAGG;IACH,iCAA+D;IAE/D;;;OAGG;IACH,qCAAuE;IAEvE;;;OAGG;IACH,6BAAuD;IAEvD;;;OAGG;IACH,cAAU;IAEV;;;OAGG;IACH,gBAAmB;IAEnB;;;OAGG;IACH,eAAgB;IAEhB;;;OAGG;IACH,qBAA+C;IAE/C;;;OAGG;IACH,iCAAwE;IAExE;;;OAGG;IACH,wBAAsD;IAEtD;;;OAGG;IACH,yBAAwE;IAExE;;OAEG;IACH,oBAFU,MAAM,GAAC,OAAO,CAEoC;IAE5D;;;OAGG;IACH,8BAAiE;IAEjE;;;OAGG;IACH,gCAAsE;IAEtE;;;OAGG;IACH,qBAA6D;IAE7D;;;OAGG;IACH,yBAAyE;IAEzE;;;OAGG;IACH,qBAAwB;IA4B1B;;;OAGG;IACH,kBAFY,mBAAY,IAAI,CAI3B;IAED;;;OAGG;IACH,qBASC;IAED;;;;;;OAMG;IACH,mBAuCC;IAED;;;OAGG;IACH,0BAgBC;IAED;;;OAGG;IACH,uBAsBC;IAED;;;;OAIG;IACH,oBAUC;IAED;;;;OAIG;IACH,sBAqBC;IAED;;;OAGG;IACH,mBAFY,QAAQ,qBAAgB,GAAC,SAAS,CAAC,CAO9C;IAED;;;;;;OAMG;IACH,4BAFY,QAAQ,qBAAgB,GAAC,SAAS,CAAC,CAoE9C;IAED;;;;OAIG;IACH,oBA0DC;IAED;;;;OAIG;IACH,gCAgBC;IAED;;;;;OAKG;IACH,kBAIC;IAED;;;OAGG;IACH,sBA8BC;IAED;;OAEG;IACH,sBAqBC;IAED;;;OAGG;IACH,iBAFY,OAAO,CAQlB;IAED;;;OAGG;IACH,kBAFY,MAAM,IAAI,CAAC,CActB;IAED;;;;OAIG;IACH,kBAHW,MAAM,MAAM,QAAM,CAAC,GAAC,IAAI,gBAkBlC;IAED;;;;OAIG;IACH,WAFY,YAAU,CAIrB;IAED;;;;OAIG;IACH,aAFY,YAAY,CAIvB;CAiCF;uBAjwBsB,mBAAmB;wBAIlB,oBAAoB;sBADtB,kBAAkB"}