ol 7.1.1-pr.14101.2 → 7.2.0

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 (190) hide show
  1. package/AssertionError.d.ts.map +1 -1
  2. package/AssertionError.js +1 -0
  3. package/DataTile.d.ts +34 -11
  4. package/DataTile.d.ts.map +1 -1
  5. package/DataTile.js +84 -7
  6. package/Feature.d.ts +3 -3
  7. package/Feature.js +3 -3
  8. package/Geolocation.d.ts +34 -27
  9. package/Geolocation.d.ts.map +1 -1
  10. package/Geolocation.js +30 -12
  11. package/Map.d.ts +19 -6
  12. package/Map.d.ts.map +1 -1
  13. package/Map.js +70 -43
  14. package/MapBrowserEventHandler.d.ts.map +1 -1
  15. package/MapBrowserEventHandler.js +9 -13
  16. package/Overlay.d.ts +1 -1
  17. package/Overlay.js +1 -1
  18. package/README.md +9 -1
  19. package/Tile.d.ts +2 -2
  20. package/Tile.js +1 -1
  21. package/TileCache.d.ts.map +1 -1
  22. package/TileCache.js +6 -8
  23. package/array.d.ts +2 -2
  24. package/array.d.ts.map +1 -1
  25. package/array.js +4 -4
  26. package/console.d.ts +13 -0
  27. package/console.d.ts.map +1 -0
  28. package/console.js +54 -0
  29. package/control/MousePosition.d.ts +12 -0
  30. package/control/MousePosition.d.ts.map +1 -1
  31. package/control/MousePosition.js +14 -0
  32. package/coordinate.d.ts +11 -11
  33. package/coordinate.js +11 -11
  34. package/dist/ol.js +1 -3
  35. package/dist/ol.js.map +1 -1
  36. package/featureloader.d.ts.map +1 -1
  37. package/featureloader.js +0 -1
  38. package/format/KML.js +3 -1
  39. package/geom/flat/interiorpoint.js +2 -2
  40. package/interaction/DragPan.d.ts.map +1 -1
  41. package/interaction/DragPan.js +3 -2
  42. package/interaction/Draw.d.ts.map +1 -1
  43. package/interaction/Draw.js +11 -14
  44. package/interaction/KeyboardPan.d.ts.map +1 -1
  45. package/interaction/KeyboardPan.js +0 -1
  46. package/interaction/KeyboardZoom.d.ts.map +1 -1
  47. package/interaction/KeyboardZoom.js +0 -1
  48. package/interaction/Link.d.ts +14 -0
  49. package/interaction/Link.d.ts.map +1 -1
  50. package/interaction/Link.js +37 -6
  51. package/interaction/Modify.d.ts +10 -10
  52. package/interaction/Modify.d.ts.map +1 -1
  53. package/interaction/Modify.js +15 -15
  54. package/interaction/PinchRotate.d.ts.map +1 -1
  55. package/interaction/PinchRotate.js +3 -5
  56. package/interaction/PinchZoom.d.ts.map +1 -1
  57. package/interaction/PinchZoom.js +3 -5
  58. package/interaction/Pointer.d.ts +5 -2
  59. package/interaction/Pointer.d.ts.map +1 -1
  60. package/interaction/Pointer.js +2 -2
  61. package/interaction/Select.d.ts.map +1 -1
  62. package/interaction/Select.js +4 -5
  63. package/interaction/Snap.d.ts +1 -1
  64. package/interaction/Snap.d.ts.map +1 -1
  65. package/interaction/Snap.js +17 -23
  66. package/interaction/Translate.d.ts +12 -11
  67. package/interaction/Translate.d.ts.map +1 -1
  68. package/interaction/Translate.js +16 -13
  69. package/layer/BaseVector.js +1 -1
  70. package/layer/Graticule.d.ts.map +1 -1
  71. package/layer/Graticule.js +4 -4
  72. package/layer/Heatmap.js +10 -10
  73. package/layer/Layer.d.ts +2 -2
  74. package/layer/Layer.d.ts.map +1 -1
  75. package/layer/Layer.js +2 -2
  76. package/layer/VectorTile.js +1 -1
  77. package/package.json +2 -2
  78. package/proj.d.ts +2 -4
  79. package/proj.d.ts.map +1 -1
  80. package/proj.js +4 -6
  81. package/render/canvas/ExecutorGroup.d.ts.map +1 -1
  82. package/render/canvas/ExecutorGroup.js +6 -4
  83. package/render/canvas/Immediate.d.ts +5 -0
  84. package/render/canvas/Immediate.d.ts.map +1 -1
  85. package/render/canvas/Immediate.js +15 -0
  86. package/render/canvas/hitdetect.d.ts +4 -3
  87. package/render/canvas/hitdetect.d.ts.map +1 -1
  88. package/render/canvas/hitdetect.js +23 -11
  89. package/render/webgl/BatchRenderer.d.ts.map +1 -1
  90. package/render/webgl/BatchRenderer.js +2 -3
  91. package/render/webgl/LineStringBatchRenderer.d.ts.map +1 -1
  92. package/render/webgl/LineStringBatchRenderer.js +2 -4
  93. package/render/webgl/PointBatchRenderer.d.ts.map +1 -1
  94. package/render/webgl/PointBatchRenderer.js +2 -4
  95. package/render/webgl/PolygonBatchRenderer.d.ts.map +1 -1
  96. package/render/webgl/PolygonBatchRenderer.js +2 -4
  97. package/render.d.ts +3 -3
  98. package/render.d.ts.map +1 -1
  99. package/render.js +6 -4
  100. package/renderer/Layer.d.ts +2 -2
  101. package/renderer/Layer.d.ts.map +1 -1
  102. package/renderer/Layer.js +3 -4
  103. package/renderer/canvas/Layer.d.ts.map +1 -1
  104. package/renderer/canvas/Layer.js +3 -4
  105. package/renderer/canvas/TileLayer.js +2 -2
  106. package/renderer/canvas/VectorImageLayer.d.ts +6 -0
  107. package/renderer/canvas/VectorImageLayer.d.ts.map +1 -1
  108. package/renderer/canvas/VectorImageLayer.js +22 -25
  109. package/renderer/canvas/VectorLayer.d.ts +9 -2
  110. package/renderer/canvas/VectorLayer.d.ts.map +1 -1
  111. package/renderer/canvas/VectorLayer.js +87 -93
  112. package/renderer/canvas/VectorTileLayer.js +84 -84
  113. package/renderer/webgl/PointsLayer.d.ts.map +1 -1
  114. package/renderer/webgl/PointsLayer.js +10 -13
  115. package/renderer/webgl/TileLayer.d.ts.map +1 -1
  116. package/renderer/webgl/TileLayer.js +2 -4
  117. package/reproj/DataTile.d.ts +75 -17
  118. package/reproj/DataTile.d.ts.map +1 -1
  119. package/reproj/DataTile.js +121 -120
  120. package/reproj/Tile.d.ts +3 -3
  121. package/reproj/Tile.d.ts.map +1 -1
  122. package/reproj/Tile.js +37 -41
  123. package/reproj/Triangulation.d.ts.map +1 -1
  124. package/reproj/Triangulation.js +42 -44
  125. package/source/BingMaps.d.ts.map +1 -1
  126. package/source/BingMaps.js +33 -38
  127. package/source/DataTile.d.ts +5 -3
  128. package/source/DataTile.d.ts.map +1 -1
  129. package/source/DataTile.js +24 -20
  130. package/source/GeoTIFF.d.ts +10 -7
  131. package/source/GeoTIFF.d.ts.map +1 -1
  132. package/source/GeoTIFF.js +49 -20
  133. package/source/Image.d.ts +8 -0
  134. package/source/Image.d.ts.map +1 -1
  135. package/source/Image.js +13 -11
  136. package/source/OGCMapTile.d.ts +1 -0
  137. package/source/OGCMapTile.d.ts.map +1 -1
  138. package/source/OGCMapTile.js +3 -1
  139. package/source/OGCVectorTile.d.ts +1 -0
  140. package/source/OGCVectorTile.d.ts.map +1 -1
  141. package/source/OGCVectorTile.js +3 -1
  142. package/source/Raster.d.ts +16 -0
  143. package/source/Raster.d.ts.map +1 -1
  144. package/source/Raster.js +47 -7
  145. package/source/Source.d.ts +2 -2
  146. package/source/Source.d.ts.map +1 -1
  147. package/source/Source.js +3 -4
  148. package/source/Stamen.js +2 -2
  149. package/source/Tile.d.ts.map +1 -1
  150. package/source/Tile.js +7 -3
  151. package/source/TileImage.d.ts +2 -2
  152. package/source/TileImage.d.ts.map +1 -1
  153. package/source/TileImage.js +3 -4
  154. package/source/UTFGrid.d.ts.map +1 -1
  155. package/source/UTFGrid.js +3 -6
  156. package/source/Vector.d.ts +6 -6
  157. package/source/Vector.js +13 -13
  158. package/source/VectorTile.d.ts.map +1 -1
  159. package/source/VectorTile.js +5 -9
  160. package/source/Zoomify.d.ts.map +1 -1
  161. package/source/Zoomify.js +4 -7
  162. package/style/Icon.d.ts +51 -0
  163. package/style/Icon.d.ts.map +1 -1
  164. package/style/Icon.js +119 -0
  165. package/style/IconImage.d.ts.map +1 -1
  166. package/style/IconImage.js +3 -1
  167. package/style/Image.d.ts.map +1 -1
  168. package/style/Image.js +1 -0
  169. package/style/Style.d.ts +2 -2
  170. package/style/Style.js +2 -2
  171. package/style/expressions.js +5 -10
  172. package/tilegrid/TileGrid.d.ts.map +1 -1
  173. package/tilegrid/TileGrid.js +7 -12
  174. package/util.d.ts.map +1 -1
  175. package/util.js +1 -1
  176. package/webgl/Helper.d.ts +4 -0
  177. package/webgl/Helper.d.ts.map +1 -1
  178. package/webgl/Helper.js +78 -79
  179. package/webgl/PostProcessingPass.d.ts +2 -2
  180. package/webgl/PostProcessingPass.d.ts.map +1 -1
  181. package/webgl/PostProcessingPass.js +7 -9
  182. package/webgl/ShaderBuilder.d.ts +1 -1
  183. package/webgl/ShaderBuilder.js +1 -1
  184. package/webgl/TileTexture.d.ts +19 -2
  185. package/webgl/TileTexture.d.ts.map +1 -1
  186. package/webgl/TileTexture.js +93 -46
  187. package/worker/webgl.js +1 -1
  188. package/layer/STAC.d.ts +0 -257
  189. package/layer/STAC.d.ts.map +0 -1
  190. package/layer/STAC.js +0 -312
@@ -277,47 +277,42 @@ class BingMaps extends TileImage {
277
277
  this.getProjection()
278
278
  );
279
279
 
280
- this.setAttributions(
281
- function (frameState) {
282
- const attributions = [];
283
- const viewState = frameState.viewState;
284
- const tileGrid = this.getTileGrid();
285
- const z = tileGrid.getZForResolution(
286
- viewState.resolution,
287
- this.zDirection
288
- );
289
- const tileCoord = tileGrid.getTileCoordForCoordAndZ(
290
- viewState.center,
291
- z
292
- );
293
- const zoom = tileCoord[0];
294
- resource.imageryProviders.map(function (imageryProvider) {
295
- let intersecting = false;
296
- const coverageAreas = imageryProvider.coverageAreas;
297
- for (let i = 0, ii = coverageAreas.length; i < ii; ++i) {
298
- const coverageArea = coverageAreas[i];
299
- if (
300
- zoom >= coverageArea.zoomMin &&
301
- zoom <= coverageArea.zoomMax
302
- ) {
303
- const bbox = coverageArea.bbox;
304
- const epsg4326Extent = [bbox[1], bbox[0], bbox[3], bbox[2]];
305
- const extent = applyTransform(epsg4326Extent, transform);
306
- if (intersects(extent, frameState.extent)) {
307
- intersecting = true;
308
- break;
309
- }
280
+ this.setAttributions((frameState) => {
281
+ const attributions = [];
282
+ const viewState = frameState.viewState;
283
+ const tileGrid = this.getTileGrid();
284
+ const z = tileGrid.getZForResolution(
285
+ viewState.resolution,
286
+ this.zDirection
287
+ );
288
+ const tileCoord = tileGrid.getTileCoordForCoordAndZ(
289
+ viewState.center,
290
+ z
291
+ );
292
+ const zoom = tileCoord[0];
293
+ resource.imageryProviders.map(function (imageryProvider) {
294
+ let intersecting = false;
295
+ const coverageAreas = imageryProvider.coverageAreas;
296
+ for (let i = 0, ii = coverageAreas.length; i < ii; ++i) {
297
+ const coverageArea = coverageAreas[i];
298
+ if (zoom >= coverageArea.zoomMin && zoom <= coverageArea.zoomMax) {
299
+ const bbox = coverageArea.bbox;
300
+ const epsg4326Extent = [bbox[1], bbox[0], bbox[3], bbox[2]];
301
+ const extent = applyTransform(epsg4326Extent, transform);
302
+ if (intersects(extent, frameState.extent)) {
303
+ intersecting = true;
304
+ break;
310
305
  }
311
306
  }
312
- if (intersecting) {
313
- attributions.push(imageryProvider.attribution);
314
- }
315
- });
307
+ }
308
+ if (intersecting) {
309
+ attributions.push(imageryProvider.attribution);
310
+ }
311
+ });
316
312
 
317
- attributions.push(TOS_ATTRIBUTION);
318
- return attributions;
319
- }.bind(this)
320
- );
313
+ attributions.push(TOS_ATTRIBUTION);
314
+ return attributions;
315
+ });
321
316
  }
322
317
 
323
318
  this.setState('ready');
@@ -8,6 +8,7 @@ export type Options = {
8
8
  /**
9
9
  * Data loader. Called with z, x, and y tile coordinates.
10
10
  * Returns {@link import ("../DataTile.js").Data data} for a tile or a promise for the same.
11
+ * For loaders that generate images, the promise should not resolve until the image is loaded.
11
12
  */
12
13
  loader?: Loader | undefined;
13
14
  /**
@@ -84,6 +85,7 @@ export type Options = {
84
85
  * @typedef {Object} Options
85
86
  * @property {Loader} [loader] Data loader. Called with z, x, and y tile coordinates.
86
87
  * Returns {@link import("../DataTile.js").Data data} for a tile or a promise for the same.
88
+ * For loaders that generate images, the promise should not resolve until the image is loaded.
87
89
  * @property {import("./Source.js").AttributionLike} [attributions] Attributions.
88
90
  * @property {boolean} [attributionsCollapsible=true] Attributions are collapsible.
89
91
  * @property {number} [maxZoom=42] Optional max zoom level. Not used if `tileGrid` is provided.
@@ -183,11 +185,11 @@ declare class DataTileSource extends TileSource {
183
185
  * @param {number} z Tile coordinate z.
184
186
  * @param {number} x Tile coordinate x.
185
187
  * @param {number} y Tile coordinate y.
186
- * @param {import("../proj/Projection.js").default} targetProjection The output projection.
187
- * @param {import("../proj/Projection.js").default} sourceProjection The input projection.
188
+ * @param {import("../proj/Projection.js").default} targetProj The output projection.
189
+ * @param {import("../proj/Projection.js").default} sourceProj The input projection.
188
190
  * @return {!DataTile} Tile.
189
191
  */
190
- getReprojTile_(z: number, x: number, y: number, targetProjection: import("../proj/Projection.js").default, sourceProjection: import("../proj/Projection.js").default): DataTile;
192
+ getReprojTile_(z: number, x: number, y: number, targetProj: import("../proj/Projection.js").default, sourceProj: import("../proj/Projection.js").default): DataTile;
191
193
  /**
192
194
  * @param {number} z Tile coordinate z.
193
195
  * @param {number} x Tile coordinate x.
@@ -1 +1 @@
1
- {"version":3,"file":"DataTile.d.ts","sourceRoot":"","sources":["DataTile.js"],"names":[],"mappings":";;;;;4BAwBsB,MAAM,QAAE,MAAM,QAAE,MAAM,KAAI,CAAC,OAAO,gBAAgB,EAAE,IAAI,GAAC,QAAQ,OAAO,gBAAgB,EAAE,IAAI,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiBxG,OAAO,YAAY,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AApBjD;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;;;;;GAMG;AACH;IACE;;OAEG;IACH,qBAFW,OAAO,EA6EjB;IA/CC;;;OAGG;IACH,gBAAgE;IAEhE;;;OAGG;IACH,kBAAmE;IAEnE;;;OAGG;IACH,mBAAsB;IAEtB;;;OAGG;IACH,yBAA0B;IAE1B;;OAEG;IACH,gBAA6B;IAgL/B;;;OAGG;IACH,yBAFW,OAAO,oBAAoB,EAAE,OAAO,QAsB9C;IApMC;;OAEG;IACH,WAFU,MAAM,CAEwD;IAExE;;;OAGG;IACH,+BAAgC;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B9C;IAvMC;;OAEG;IACH,WAFU,MAAM,CAEwD;IAExE;;;OAGG;IACH,+BAAgC;IAEhC;;;OAGG;IACH,gCAAiC;IAGnC;;;;;OAKG;IACH,kCAFW,MAAM,OAAO,YAAY,EAAE,IAAI,CAAC,QAI1C;IAED;;;;;;OAMG;IACH,yBAHW,MAAM,GACL,OAAO,YAAY,EAAE,IAAI,CAWpC;IAeD;;;OAGG;IACH,4BAHW,MAAM,QAKhB;IAED;;;;;;;OAOG;IACH,kBAPW,MAAM,KACN,MAAM,KACN,MAAM,cACN,OAAO,uBAAuB,EAAE,OAAO,cACvC,OAAO,uBAAuB,EAAE,OAAO,GACrC,QAAQ,CAmDpB;IAED;;;;;;;OAOG;IACH,WAPW,MAAM,KACN,MAAM,KACN,MAAM,cACN,MAAM,cACN,OAAO,uBAAuB,EAAE,OAAO,GACrC,QAAQ,CAyCpB;IA8CD;;;;;;;;;;;OAWG;IACH,qCAJW,OAAO,YAAY,EAAE,cAAc,YACnC,OAAO,yBAAyB,EAAE,OAAO,QAWnD;CAyCF"}
@@ -29,6 +29,7 @@ import {toSize} from '../size.js';
29
29
  * @typedef {Object} Options
30
30
  * @property {Loader} [loader] Data loader. Called with z, x, and y tile coordinates.
31
31
  * Returns {@link import("../DataTile.js").Data data} for a tile or a promise for the same.
32
+ * For loaders that generate images, the promise should not resolve until the image is loaded.
32
33
  * @property {import("./Source.js").AttributionLike} [attributions] Attributions.
33
34
  * @property {boolean} [attributionsCollapsible=true] Attributions are collapsible.
34
35
  * @property {number} [maxZoom=42] Optional max zoom level. Not used if `tileGrid` is provided.
@@ -191,12 +192,12 @@ class DataTileSource extends TileSource {
191
192
  * @param {number} z Tile coordinate z.
192
193
  * @param {number} x Tile coordinate x.
193
194
  * @param {number} y Tile coordinate y.
194
- * @param {import("../proj/Projection.js").default} targetProjection The output projection.
195
- * @param {import("../proj/Projection.js").default} sourceProjection The input projection.
195
+ * @param {import("../proj/Projection.js").default} targetProj The output projection.
196
+ * @param {import("../proj/Projection.js").default} sourceProj The input projection.
196
197
  * @return {!DataTile} Tile.
197
198
  */
198
- getReprojTile_(z, x, y, targetProjection, sourceProjection) {
199
- const cache = this.getTileCacheForProjection(targetProjection);
199
+ getReprojTile_(z, x, y, targetProj, sourceProj) {
200
+ const cache = this.getTileCacheForProjection(targetProj);
200
201
  const tileCoordKey = getKeyZXY(z, x, y);
201
202
  if (cache.containsKey(tileCoordKey)) {
202
203
  const tile = cache.get(tileCoordKey);
@@ -218,27 +219,30 @@ class DataTileSource extends TileSource {
218
219
  })
219
220
  );
220
221
 
221
- const sourceTileGrid = this.getTileGridForProjection(sourceProjection);
222
- const targetTileGrid = this.getTileGridForProjection(targetProjection);
222
+ const sourceTileGrid = this.getTileGridForProjection(sourceProj);
223
+ const targetTileGrid = this.getTileGridForProjection(targetProj);
223
224
  const tileCoord = [z, x, y];
224
225
  const wrappedTileCoord = this.getTileCoordForTileUrlFunction(
225
226
  tileCoord,
226
- targetProjection
227
+ targetProj
227
228
  );
228
- const newTile = new ReprojDataTile(
229
- sourceProjection,
230
- sourceTileGrid,
231
- targetProjection,
232
- targetTileGrid,
233
- tileCoord,
234
- wrappedTileCoord,
235
- reprojTilePixelRatio,
236
- this.getGutterForProjection(sourceProjection),
237
- function (z, x, y, pixelRatio) {
238
- return this.getTile(z, x, y, pixelRatio, sourceProjection);
239
- }.bind(this),
240
- this.getInterpolate()
229
+
230
+ const options = Object.assign(
231
+ {
232
+ sourceProj,
233
+ sourceTileGrid,
234
+ targetProj,
235
+ targetTileGrid,
236
+ tileCoord,
237
+ wrappedTileCoord,
238
+ pixelRatio: reprojTilePixelRatio,
239
+ gutter: this.getGutterForProjection(sourceProj),
240
+ getTileFunction: (z, x, y, pixelRatio) =>
241
+ this.getTile(z, x, y, pixelRatio, sourceProj),
242
+ },
243
+ this.tileOptions
241
244
  );
245
+ const newTile = new ReprojDataTile(options);
242
246
  newTile.key = this.getKey();
243
247
  return newTile;
244
248
  }
@@ -156,11 +156,6 @@ export type Options = {
156
156
  * Whether the layer is opaque.
157
157
  */
158
158
  opaque?: boolean | undefined;
159
- /**
160
- * Source projection. If not provided, the GeoTIFF metadata
161
- * will be read for projection information.
162
- */
163
- projection?: import("../proj.js").ProjectionLike;
164
159
  /**
165
160
  * Duration of the opacity transition for rendering.
166
161
  * To disable the opacity transition, pass `transition: 0`.
@@ -209,8 +204,6 @@ export type Options = {
209
204
  * If instead you want to work with the raw values in a style expression, set this to `false`. Setting this option
210
205
  * to `false` will make it so any `min` and `max` properties on sources are ignored.
211
206
  * @property {boolean} [opaque=false] Whether the layer is opaque.
212
- * @property {import("../proj.js").ProjectionLike} [projection] Source projection. If not provided, the GeoTIFF metadata
213
- * will be read for projection information.
214
207
  * @property {number} [transition=250] Duration of the opacity transition for rendering.
215
208
  * To disable the opacity transition, pass `transition: 0`.
216
209
  * @property {boolean} [wrapX=false] Render tiles beyond the tile grid extent.
@@ -302,6 +295,16 @@ declare class GeoTIFFSource extends DataTile {
302
295
  * ```
303
296
  */
304
297
  getError(): Error;
298
+ /**
299
+ * Determine the projection of the images in this GeoTIFF.
300
+ * The default implementation looks at the ProjectedCSTypeGeoKey and the GeographicTypeGeoKey
301
+ * of each image in turn.
302
+ * You can override this method in a subclass to support more projections.
303
+ *
304
+ * @param {Array<Array<GeoTIFFImage>>} sources Each source is a list of images
305
+ * from a single GeoTIFF.
306
+ */
307
+ determineProjection(sources: Array<Array<GeoTIFFImage>>): void;
305
308
  /**
306
309
  * Configure the tile grid based on images within the source GeoTIFFs. Each GeoTIFF
307
310
  * must have the same internal tiled structure.
@@ -1 +1 @@
1
- {"version":3,"file":"GeoTIFF.d.ts","sourceRoot":"","sources":["GeoTIFF.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAmFc,MAAM;;;;wBACN,MAAM;;;;4BACN,MAAM;;;;6BACN,MAAM;;;;6BACN,MAAM;;;;0BACN,MAAM;;;;2BACN,MAAM;;;;2BACN,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AE,OAAO;2BAIzB,OAAO,SAAS,EAAE,YAAY;;;;;wBAK7B,MAAM;;;;wBACN,MAAM;;2BASP,OAAO,SAAS,EAAE,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAuO7B,MAAM,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAhB/B;;;;;;;;;;;;GAYG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH;;;;;;;GAOG;AACH;IACE;;OAEG;IACH,qBAFW,OAAO,EAyGjB;IA5FC;;;OAGG;IACH,oBAAkC;IAIlC;;;OAGG;IACH,uBAA2C;IAE3C;;;OAGG;IACH,uBAA2C;IAE3C;;;OAGG;IACH,qBAAyC;IAEzC;;;OAGG;IACH,2BAA+C;IAE/C;;;OAGG;IACH,yBAAqB;IAErB;;;OAGG;IACH,sBAAkB;IAElB;;;OAGG;IACH,kBAAc;IAEd;;;OAGG;IACH,mBAA6C;IAE7C;;;OAGG;IACH,kBAAsB;IAEtB;;;OAGG;IACH,eAAkB;IAElB;;OAEG;IACH,eAFU,IAAI,GAAC,KAAK,GAAC,MAAM,CAEuB;IAuBpD;;;;;;;;;;;OAWG;IACH,YAXY,KAAK,CAahB;IAED;;;;;;;;OAQG;IACH,6BAHW,MAAM,MAAM,YAAY,CAAC,CAAC,QAapC;IAED;;;;;;OAMG;IACH,mBAwOC;IAED;;;;;;OAMG;IACH,kBA6EC;IAED;;;;;OAKG;IACH,qBA4GC;CACF"}
package/source/GeoTIFF.js CHANGED
@@ -18,6 +18,7 @@ import {
18
18
  } from '../proj.js';
19
19
  import {clamp} from '../math.js';
20
20
  import {getCenter, getIntersection} from '../extent.js';
21
+ import {error as logError} from '../console.js';
21
22
  import {fromCode as unitsFromCode} from '../proj/Units.js';
22
23
 
23
24
  /**
@@ -108,6 +109,8 @@ function readRGB(preference, image) {
108
109
  const STATISTICS_MAXIMUM = 'STATISTICS_MAXIMUM';
109
110
  const STATISTICS_MINIMUM = 'STATISTICS_MINIMUM';
110
111
 
112
+ const defaultTileSize = 256;
113
+
111
114
  /**
112
115
  * @typedef {import("geotiff").GeoTIFFImage} GeoTIFFImage
113
116
  */
@@ -178,7 +181,10 @@ function getProjection(image) {
178
181
  return null;
179
182
  }
180
183
 
181
- if (geoKeys.ProjectedCSTypeGeoKey) {
184
+ if (
185
+ geoKeys.ProjectedCSTypeGeoKey &&
186
+ geoKeys.ProjectedCSTypeGeoKey !== 32767
187
+ ) {
182
188
  const code = 'EPSG:' + geoKeys.ProjectedCSTypeGeoKey;
183
189
  let projection = getCachedProjection(code);
184
190
  if (!projection) {
@@ -193,7 +199,7 @@ function getProjection(image) {
193
199
  return projection;
194
200
  }
195
201
 
196
- if (geoKeys.GeographicTypeGeoKey) {
202
+ if (geoKeys.GeographicTypeGeoKey && geoKeys.GeographicTypeGeoKey !== 32767) {
197
203
  const code = 'EPSG:' + geoKeys.GeographicTypeGeoKey;
198
204
  let projection = getCachedProjection(code);
199
205
  if (!projection) {
@@ -355,8 +361,6 @@ function getMaxForDataType(array) {
355
361
  * If instead you want to work with the raw values in a style expression, set this to `false`. Setting this option
356
362
  * to `false` will make it so any `min` and `max` properties on sources are ignored.
357
363
  * @property {boolean} [opaque=false] Whether the layer is opaque.
358
- * @property {import("../proj.js").ProjectionLike} [projection] Source projection. If not provided, the GeoTIFF metadata
359
- * will be read for projection information.
360
364
  * @property {number} [transition=250] Duration of the opacity transition for rendering.
361
365
  * To disable the opacity transition, pass `transition: 0`.
362
366
  * @property {boolean} [wrapX=false] Render tiles beyond the tile grid extent.
@@ -380,7 +384,7 @@ class GeoTIFFSource extends DataTile {
380
384
  super({
381
385
  state: 'loading',
382
386
  tileGrid: null,
383
- projection: options.projection || null,
387
+ projection: null,
384
388
  opaque: options.opaque,
385
389
  transition: options.transition,
386
390
  interpolate: options.interpolate !== false,
@@ -475,7 +479,7 @@ class GeoTIFFSource extends DataTile {
475
479
  self.configure_(sources);
476
480
  })
477
481
  .catch(function (error) {
478
- console.error(error); // eslint-disable-line no-console
482
+ logError(error);
479
483
  self.error_ = error;
480
484
  self.setState('error');
481
485
  });
@@ -497,6 +501,27 @@ class GeoTIFFSource extends DataTile {
497
501
  return this.error_;
498
502
  }
499
503
 
504
+ /**
505
+ * Determine the projection of the images in this GeoTIFF.
506
+ * The default implementation looks at the ProjectedCSTypeGeoKey and the GeographicTypeGeoKey
507
+ * of each image in turn.
508
+ * You can override this method in a subclass to support more projections.
509
+ *
510
+ * @param {Array<Array<GeoTIFFImage>>} sources Each source is a list of images
511
+ * from a single GeoTIFF.
512
+ */
513
+ determineProjection(sources) {
514
+ const firstSource = sources[0];
515
+ for (let i = firstSource.length - 1; i >= 0; --i) {
516
+ const image = firstSource[i];
517
+ const projection = getProjection(image);
518
+ if (projection) {
519
+ this.projection = projection;
520
+ break;
521
+ }
522
+ }
523
+ }
524
+
500
525
  /**
501
526
  * Configure the tile grid based on images within the source GeoTIFFs. Each GeoTIFF
502
527
  * must have the same internal tiled structure.
@@ -567,6 +592,16 @@ class GeoTIFFSource extends DataTile {
567
592
  sourceResolutions[level] = imageResolutions[0];
568
593
 
569
594
  const sourceTileSize = [image.getTileWidth(), image.getTileHeight()];
595
+
596
+ // request larger blocks for untiled layouts
597
+ if (
598
+ sourceTileSize[0] !== sourceTileSize[1] &&
599
+ sourceTileSize[1] < defaultTileSize
600
+ ) {
601
+ sourceTileSize[0] = defaultTileSize;
602
+ sourceTileSize[1] = defaultTileSize;
603
+ }
604
+
570
605
  sourceTileSizes[level] = sourceTileSize;
571
606
 
572
607
  const aspectRatio = imageResolutions[0] / Math.abs(imageResolutions[1]);
@@ -649,15 +684,7 @@ class GeoTIFFSource extends DataTile {
649
684
  }
650
685
 
651
686
  if (!this.getProjection()) {
652
- const firstSource = sources[0];
653
- for (let i = firstSource.length - 1; i >= 0; --i) {
654
- const image = firstSource[i];
655
- const projection = getProjection(image);
656
- if (projection) {
657
- this.projection = projection;
658
- break;
659
- }
660
- }
687
+ this.determineProjection(sources);
661
688
  }
662
689
 
663
690
  this.samplesPerPixel_ = samplesPerPixel;
@@ -719,11 +746,13 @@ class GeoTIFFSource extends DataTile {
719
746
  this.setLoader(this.loadTile_.bind(this));
720
747
  this.setState('ready');
721
748
 
722
- let zoom = 0;
723
- if (resolutions.length === 1) {
724
- resolutions = [resolutions[0] * 2, resolutions[0]];
725
- zoom = 1;
749
+ const zoom = 1;
750
+ if (resolutions.length === 2) {
751
+ resolutions = [resolutions[0], resolutions[1], resolutions[1] / 2];
752
+ } else if (resolutions.length === 1) {
753
+ resolutions = [resolutions[0] * 2, resolutions[0], resolutions[0] / 2];
726
754
  }
755
+
727
756
  this.viewResolver({
728
757
  showFullExtent: true,
729
758
  projection: this.projection,
@@ -815,7 +844,7 @@ class GeoTIFFSource extends DataTile {
815
844
  return Promise.all(requests)
816
845
  .then(this.composeTile_.bind(this, sourceTileSize))
817
846
  .catch(function (error) {
818
- console.error(error); // eslint-disable-line no-console
847
+ logError(error);
819
848
  throw error;
820
849
  });
821
850
  }
package/source/Image.d.ts CHANGED
@@ -120,6 +120,14 @@ declare class ImageSource extends Source {
120
120
  * @type {number}
121
121
  */
122
122
  private reprojectedRevision_;
123
+ /**
124
+ * @return {Array<number>|null} Resolutions.
125
+ */
126
+ getResolutions(): Array<number> | null;
127
+ /**
128
+ * @param {Array<number>|null} resolutions Resolutions.
129
+ */
130
+ setResolutions(resolutions: Array<number> | null): void;
123
131
  /**
124
132
  * @protected
125
133
  * @param {number} resolution Resolution.
@@ -1 +1 @@
1
- {"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["Image.js"],"names":[],"mappings":"AAgQA;;;;;GAKG;AACH,gDAHW,OAAO,aAAa,EAAE,OAAO,OAC7B,MAAM,QAIhB;mCA3PS,MAAM;;;;;;AAyBhB;;GAEG;AAEH;;;;GAIG;AACH;IACE;;;OAGG;IACH,kBAHW,MAAM,SACN,OAAO,aAAa,EAAE,OAAO,EAWvC;IANC;;;;O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O,WAAW,EAAE,SAAS,CAAC,CAEtD;IAET;;OAEG;IACH,IAFU,uBAAuB,IAAI,CAAC,CAE/B;IAEP;;;OAGG;IACH,qBACgE;IAEhE;;;OAGG;IACH,0BAA6B;IAE7B;;;OAGG;IACH,6BAA6B;IAG/B;;OAEG;IACH,kBAFY,MAAM,MAAM,CAAC,GAAC,IAAI,CAI7B;IAED;;OAEG;IACH,4BAFW,MAAM,MAAM,CAAC,GAAC,IAAI,QAI5B;IAED;;;;OAIG;IACH,4CAHW,MAAM,GACL,MAAM,CASjB;IAED;;;;;;OAMG;IACH,iBANW,OAAO,cAAc,EAAE,MAAM,cAC7B,MAAM,cACN,MAAM,cACN,OAAO,uBAAuB,EAAE,OAAO,GACtC,OAAO,iBAAiB,EAAE,OAAO,CAwC5C;IAED;;;;;;;;OAQG;IACH,mCAPW,OAAO,cAAc,EAAE,MAAM,cAC7B,MAAM,cACN,MAAM,cACN,OAAO,uBAAuB,EAAE,OAAO,GACtC,OAAO,iBAAiB,EAAE,OAAO,CAK5C;IAED;;;;OAIG;IACH,mCAHW,OAAO,oBAAoB,EAAE,OAAO,QAyB9C;CACF"}
package/source/Image.js CHANGED
@@ -145,15 +145,23 @@ class ImageSource extends Source {
145
145
  return this.resolutions_;
146
146
  }
147
147
 
148
+ /**
149
+ * @param {Array<number>|null} resolutions Resolutions.
150
+ */
151
+ setResolutions(resolutions) {
152
+ this.resolutions_ = resolutions;
153
+ }
154
+
148
155
  /**
149
156
  * @protected
150
157
  * @param {number} resolution Resolution.
151
158
  * @return {number} Resolution.
152
159
  */
153
160
  findNearestResolution(resolution) {
154
- if (this.resolutions_) {
155
- const idx = linearFindNearest(this.resolutions_, resolution, 0);
156
- resolution = this.resolutions_[idx];
161
+ const resolutions = this.getResolutions();
162
+ if (resolutions) {
163
+ const idx = linearFindNearest(resolutions, resolution, 0);
164
+ resolution = resolutions[idx];
157
165
  }
158
166
  return resolution;
159
167
  }
@@ -196,14 +204,8 @@ class ImageSource extends Source {
196
204
  extent,
197
205
  resolution,
198
206
  pixelRatio,
199
- function (extent, resolution, pixelRatio) {
200
- return this.getImageInternal(
201
- extent,
202
- resolution,
203
- pixelRatio,
204
- sourceProjection
205
- );
206
- }.bind(this),
207
+ (extent, resolution, pixelRatio) =>
208
+ this.getImageInternal(extent, resolution, pixelRatio, sourceProjection),
207
209
  this.getInterpolate()
208
210
  );
209
211
  this.reprojectedRevision_ = this.getRevision();
@@ -97,6 +97,7 @@ export type Options = {
97
97
  * Layer source for map tiles from an [OGC API - Tiles](https://ogcapi.ogc.org/tiles/) service that provides "map" type tiles.
98
98
  * The service must conform to at least the core (http://www.opengis.net/spec/ogcapi-tiles-1/1.0/conf/core)
99
99
  * and tileset (http://www.opengis.net/spec/ogcapi-tiles-1/1.0/conf/tileset) conformance classes.
100
+ * @api
100
101
  */
101
102
  declare class OGCMapTile extends TileImage {
102
103
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"OGCMapTile.d.ts","sourceRoot":"","sources":["OGCMapTile.js"],"names":[],"mappings":";;;;;SAQc,MAAM;;;;;;;;;;;;;;;;iBAKN,OAAO,YAAY,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAPjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH;;;;;GAKG;AACH;IACE;;OAEG;IACH,qBAFW,OAAO,EA0BjB;IAED;;;OAGG;IACH,2BAIC;IAED;;;OAGG;IACH,qBAGC;CACF"}
1
+ {"version":3,"file":"OGCMapTile.d.ts","sourceRoot":"","sources":["OGCMapTile.js"],"names":[],"mappings":";;;;;SASc,MAAM;;;;;;;;;;;;;;;;iBAKN,OAAO,YAAY,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAPjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH;;;;;;GAMG;AACH;IACE;;OAEG;IACH,qBAFW,OAAO,EA0BjB;IAED;;;OAGG;IACH,2BAIC;IAED;;;OAGG;IACH,qBAGC;CACF"}
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import TileImage from './TileImage.js';
5
5
  import {getTileSetInfo} from './ogcTileUtil.js';
6
+ import {error as logError} from '../console.js';
6
7
 
7
8
  /**
8
9
  * @typedef {Object} Options
@@ -39,6 +40,7 @@ import {getTileSetInfo} from './ogcTileUtil.js';
39
40
  * Layer source for map tiles from an [OGC API - Tiles](https://ogcapi.ogc.org/tiles/) service that provides "map" type tiles.
40
41
  * The service must conform to at least the core (http://www.opengis.net/spec/ogcapi-tiles-1/1.0/conf/core)
41
42
  * and tileset (http://www.opengis.net/spec/ogcapi-tiles-1/1.0/conf/tileset) conformance classes.
43
+ * @api
42
44
  */
43
45
  class OGCMapTile extends TileImage {
44
46
  /**
@@ -85,7 +87,7 @@ class OGCMapTile extends TileImage {
85
87
  * @param {Error} error The error.
86
88
  */
87
89
  handleError_(error) {
88
- console.error(error); // eslint-disable-line no-console
90
+ logError(error);
89
91
  this.setState('error');
90
92
  }
91
93
  }
@@ -101,6 +101,7 @@ export type Options = {
101
101
  * Vector tile sets may come in a variety of formats (e.g. GeoJSON, MVT). The `format` option is used to determine
102
102
  * which of the advertised media types is used. If you need to force the use of a particular media type, you can
103
103
  * provide the `mediaType` option.
104
+ * @api
104
105
  */
105
106
  declare class OGCVectorTile extends VectorTile {
106
107
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"OGCVectorTile.d.ts","sourceRoot":"","sources":["OGCVectorTile.js"],"names":[],"mappings":";;;;;SASc,MAAM;;;;;;;;;YAGN,OAAO,sBAAsB,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUtC,OAAO,YAAY,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;AAfjD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH;;;;;;;;;GASG;AACH;IACE;;OAEG;IACH,qBAFW,OAAO,EA4BjB;IAED;;;OAGG;IACH,2BAIC;IAED;;;OAGG;IACH,qBAGC;CACF"}
1
+ {"version":3,"file":"OGCVectorTile.d.ts","sourceRoot":"","sources":["OGCVectorTile.js"],"names":[],"mappings":";;;;;SAUc,MAAM;;;;;;;;;YAGN,OAAO,sBAAsB,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUtC,OAAO,YAAY,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;AAfjD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH;;;;;;;;;;GAUG;AACH;IACE;;OAEG;IACH,qBAFW,OAAO,EA4BjB;IAED;;;OAGG;IACH,2BAIC;IAED;;;OAGG;IACH,qBAGC;CACF"}
@@ -4,6 +4,7 @@
4
4
 
5
5
  import VectorTile from './VectorTile.js';
6
6
  import {getTileSetInfo} from './ogcTileUtil.js';
7
+ import {error as logError} from '../console.js';
7
8
 
8
9
  /**
9
10
  * @typedef {Object} Options
@@ -43,6 +44,7 @@ import {getTileSetInfo} from './ogcTileUtil.js';
43
44
  * Vector tile sets may come in a variety of formats (e.g. GeoJSON, MVT). The `format` option is used to determine
44
45
  * which of the advertised media types is used. If you need to force the use of a particular media type, you can
45
46
  * provide the `mediaType` option.
47
+ * @api
46
48
  */
47
49
  class OGCVectorTile extends VectorTile {
48
50
  /**
@@ -91,7 +93,7 @@ class OGCVectorTile extends VectorTile {
91
93
  * @param {Error} error The error.
92
94
  */
93
95
  handleError_(error) {
94
- console.error(error); // eslint-disable-line no-console
96
+ logError(error);
95
97
  this.setState('error');
96
98
  }
97
99
  }
@@ -242,6 +242,12 @@ export type Options = {
242
242
  * be called with an array of ImageData objects from input sources.
243
243
  */
244
244
  operationType?: RasterOperationType | undefined;
245
+ /**
246
+ * Resolutions. If specified, raster operations will only
247
+ * be run at the given resolutions. By default, the resolutions of the first source with resolutions
248
+ * specified will be used, if any. Set to `null` to use any view resolution instead.
249
+ */
250
+ resolutions?: number[] | null | undefined;
245
251
  };
246
252
  /**
247
253
  * *
@@ -267,6 +273,9 @@ import Event from "../events/Event.js";
267
273
  * `'pixel'` operations are assumed, and operations will be called with an
268
274
  * array of pixels from input sources. If set to `'image'`, operations will
269
275
  * be called with an array of ImageData objects from input sources.
276
+ * @property {Array<number>|null} [resolutions] Resolutions. If specified, raster operations will only
277
+ * be run at the given resolutions. By default, the resolutions of the first source with resolutions
278
+ * specified will be used, if any. Set to `null` to use any view resolution instead.
270
279
  */
271
280
  /***
272
281
  * @template Return
@@ -323,6 +332,8 @@ declare class RasterSource extends ImageSource {
323
332
  * @type {Array<import("../layer/Layer.js").default>}
324
333
  */
325
334
  private layers_;
335
+ /** @type {boolean} */
336
+ useResolutions_: boolean;
326
337
  /**
327
338
  * @private
328
339
  * @type {import("../TileQueue.js").default}
@@ -395,6 +406,11 @@ declare class RasterSource extends ImageSource {
395
406
  * @private
396
407
  */
397
408
  private onWorkerComplete_;
409
+ /**
410
+ * @param {import("../proj/Projection").default} [projection] Projection.
411
+ * @return {Array<number>|null} Resolutions.
412
+ */
413
+ getResolutions(projection?: import("../proj/Projection.js").default | undefined): Array<number> | null;
398
414
  }
399
415
  import ImageSource from "./Image.js";
400
416
  //# sourceMappingURL=Raster.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Raster.d.ts","sourceRoot":"","sources":["Raster.js"],"names":[],"mappings":"AA4BA;;;;;GAKG;AACH,mCALW,iBAAiB,SACjB,MAAM,UACN,MAAM,GACL,SAAS,CAapB;AAgJD;;GAEG;AAEH;;;;;GAKG;AAEH;;;;;;;GAOG;AAEH;;;GAGG;AACH;IACE;;OAEG;IACH,oBAFW,gBAAgB,EAmD1B;IA9CC,mBAAkC;IAwBlC,mBAAuB;IAEvB;;;OAGG;IACH,eAAgB;IAEhB,wBAA+C;IAC/C,iBAAiB;IAEjB;;;OAGG;IACH,oBAAqB;IAErB;;;OAGG;IACH,aAAgB;IAGlB;;;;;;;;OAQG;IACH,gBAPW,MAAM,SAAS,CAAC,8BAGP,KAAK,QAAE,SAAS,g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