ol 10.2.2-dev.1728459826897 → 10.2.2-dev.1728582963505

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ol",
3
- "version": "10.2.2-dev.1728459826897",
3
+ "version": "10.2.2-dev.1728582963505",
4
4
  "description": "OpenLayers mapping library",
5
5
  "keywords": [
6
6
  "map",
@@ -26,7 +26,7 @@
26
26
  "color-rgba": "^3.0.0",
27
27
  "color-space": "^2.0.1",
28
28
  "earcut": "^3.0.0",
29
- "geotiff": "^2.0.7",
29
+ "geotiff": "^2.1.3",
30
30
  "pbf": "4.0.1",
31
31
  "rbush": "^4.0.0"
32
32
  },
@@ -448,8 +448,8 @@ class FlowLayerRenderer extends WebGLTileLayerRenderer {
448
448
  );
449
449
 
450
450
  const rotation = this.tempVec2_;
451
- rotation[0] = Math.cos(frameState.viewState.rotation);
452
- rotation[1] = Math.sin(frameState.viewState.rotation);
451
+ rotation[0] = Math.cos(-frameState.viewState.rotation);
452
+ rotation[1] = Math.sin(-frameState.viewState.rotation);
453
453
  this.helper.setUniformFloatVec2(U.ROTATION, rotation);
454
454
 
455
455
  this.helper.setUniformFloatValue(U.MAX_SPEED, this.maxSpeed_);
@@ -478,8 +478,8 @@ class FlowLayerRenderer extends WebGLTileLayerRenderer {
478
478
  helper.setUniformFloatValue(U.DROP_RATE_BUMP, this.dropRateBump_);
479
479
 
480
480
  const rotation = this.tempVec2_;
481
- rotation[0] = Math.cos(frameState.viewState.rotation);
482
- rotation[1] = Math.sin(frameState.viewState.rotation);
481
+ rotation[0] = Math.cos(-frameState.viewState.rotation);
482
+ rotation[1] = Math.sin(-frameState.viewState.rotation);
483
483
  this.helper.setUniformFloatVec2(U.ROTATION, rotation);
484
484
 
485
485
  const size = frameState.size;
@@ -61,6 +61,10 @@ export type Options = {
61
61
  * transitions in milliseconds. A duration of 0 disables the opacity transition.
62
62
  */
63
63
  transition?: number | undefined;
64
+ /**
65
+ * Source transform matrix.
66
+ */
67
+ transformMatrix?: number[] | undefined;
64
68
  /**
65
69
  * Render reprojection edges.
66
70
  */
@@ -90,6 +94,7 @@ export type Options = {
90
94
  * @property {number} [errorThreshold] Acceptable reprojection error (in px).
91
95
  * @property {number} [transition=250] A duration for tile opacity
92
96
  * transitions in milliseconds. A duration of 0 disables the opacity transition.
97
+ * @property {import("../transform.js").Transform} [transformMatrix] Source transform matrix.
93
98
  * @property {boolean} [renderEdges] Render reprojection edges.
94
99
  */
95
100
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"DataTile.d.ts","sourceRoot":"","sources":["DataTile.js"],"names":[],"mappings":";yBAsBa,CAAS,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,KAAI,OAAO,gBAAgB,EAAE,OAAO;;;;;UAK1E,QAAQ;;;;YACR,MAAM;;;;;;gBAKN,OAAO,uBAAuB,EAAE,OAAO;;;;oBACvC,OAAO,yBAAyB,EAAE,OAAO;;;;gBACzC,OAAO,uBAAuB,EAAE,OAAO;;;;oBACvC,OAAO,yBAAyB,EAAE,OAAO;;;;eACzC,OAAO,iBAAiB,EAAE,SAAS;;;;;;;;gBAEnC,MAAM;;;;YACN,MAAM;;;;qBACN,UAAU;;;;;;;;;;;;;;;;;;;;AApBxB;;GAEG;AAEH;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;;GAKG;AACH;IACE;;OAEG;IACH,qBAFW,OAAO,EAgOjB;IAtNC;;;OAGG;IACH,qBACiE;IAEjE;;;OAGG;IACH,oBAAqC;IAErC;;;OAGG;IACH,gBAA6B;IAE7B;;;OAGG;IACH,oBAAuB;IAEvB;;;OAGG;IACH,qBAAwB;IAExB;;;OAGG;IACH,oBAA4B;IAE5B;;;OAGG;IACH,wBAA6C;IAE7C;;;OAGG;IACH,wBAA6C;IAE7C;;;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IACH,oBAIwB;IAmDxB;;;OAGG;IACH,uBAQC;IAgGH;;OAEG;IACH,mBAuMC;IAqDD;;OAEG;IACH,yBAGC;CACF;qBA1jByD,gBAAgB"}
@@ -45,6 +45,7 @@ import {listen, unlistenByKey} from '../events.js';
45
45
  * @property {number} [errorThreshold] Acceptable reprojection error (in px).
46
46
  * @property {number} [transition=250] A duration for tile opacity
47
47
  * transitions in milliseconds. A duration of 0 disables the opacity transition.
48
+ * @property {import("../transform.js").Transform} [transformMatrix] Source transform matrix.
48
49
  * @property {boolean} [renderEdges] Render reprojection edges.
49
50
  */
50
51
 
@@ -213,6 +214,7 @@ class ReprojDataTile extends DataTile {
213
214
  maxSourceExtent,
214
215
  sourceResolution * errorThresholdInPixels,
215
216
  targetResolution,
217
+ options.transformMatrix,
216
218
  );
217
219
 
218
220
  if (this.triangulation_.getTriangles().length === 0) {
@@ -25,8 +25,9 @@ declare class Triangulation {
25
25
  * @param {import("../extent.js").Extent} maxSourceExtent Maximal source extent that can be used.
26
26
  * @param {number} errorThreshold Acceptable error (in source units).
27
27
  * @param {?number} destinationResolution The (optional) resolution of the destination.
28
+ * @param {import("../transform.js").Transform} [sourceMatrix] Source transform matrix.
28
29
  */
29
- constructor(sourceProj: import("../proj/Projection.js").default, targetProj: import("../proj/Projection.js").default, targetExtent: import("../extent.js").Extent, maxSourceExtent: import("../extent.js").Extent, errorThreshold: number, destinationResolution: number | null);
30
+ constructor(sourceProj: import("../proj/Projection.js").default, targetProj: import("../proj/Projection.js").default, targetExtent: import("../extent.js").Extent, maxSourceExtent: import("../extent.js").Extent, errorThreshold: number, destinationResolution: number | null, sourceMatrix?: number[] | undefined);
30
31
  /**
31
32
  * @type {import("../proj/Projection.js").default}
32
33
  * @private
@@ -1 +1 @@
1
- {"version":3,"file":"Triangulation.d.ts","sourceRoot":"","sources":["Triangulation.js"],"names":[],"mappings":";;;;;;;;YAqBc,KAAK,CAAC,OAAO,kBAAkB,EAAE,UAAU,CAAC;;;;YAC5C,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C;IAED;;;OAGG;IACH,yBAAuC;IAEvC;;;OAGG;IACH,+BAA6D;IAE7D;;;OAGG;IACH,mBAAoB;IAEpB;;;;OAIG;IACH,wBAA4B;IAE5B;;;OAGG;IACH,0BAIqE;IAErE;;;OAGG;IACH,0BAEQ;IAER;;;OAGG;IACH,0BAEQ;IA4GV;;;;;;;;;OASG;IACH,qBAKC;IAED;;;;;;;;;;;;;;;OAeG;IACH,iBA4LC;IAED;;;;OAIG;IACH,yBAFY,OAAO,cAAc,EAAE,MAAM,CAaxC;IAED;;OAEG;IACH,gBAFY,KAAK,CAAC,QAAQ,CAAC,CAI1B;CACF"}
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @module ol/reproj/Triangulation
3
3
  */
4
+ import {apply as applyMatrix} from '../transform.js';
4
5
  import {
5
6
  boundingExtent,
6
7
  createEmpty,
@@ -13,7 +14,11 @@ import {
13
14
  getWidth,
14
15
  intersects,
15
16
  } from '../extent.js';
16
- import {getTransform} from '../proj.js';
17
+ import {
18
+ createTransformFromCoordinateTransform,
19
+ getTransform,
20
+ transform,
21
+ } from '../proj.js';
17
22
  import {modulo} from '../math.js';
18
23
 
19
24
  /**
@@ -55,6 +60,7 @@ class Triangulation {
55
60
  * @param {import("../extent.js").Extent} maxSourceExtent Maximal source extent that can be used.
56
61
  * @param {number} errorThreshold Acceptable error (in source units).
57
62
  * @param {?number} destinationResolution The (optional) resolution of the destination.
63
+ * @param {import("../transform.js").Transform} [sourceMatrix] Source transform matrix.
58
64
  */
59
65
  constructor(
60
66
  sourceProj,
@@ -63,6 +69,7 @@ class Triangulation {
63
69
  maxSourceExtent,
64
70
  errorThreshold,
65
71
  destinationResolution,
72
+ sourceMatrix,
66
73
  ) {
67
74
  /**
68
75
  * @type {import("../proj/Projection.js").default}
@@ -78,7 +85,14 @@ class Triangulation {
78
85
 
79
86
  /** @type {!Object<string, import("../coordinate.js").Coordinate>} */
80
87
  let transformInvCache = {};
81
- const transformInv = getTransform(this.targetProj_, this.sourceProj_);
88
+ const transformInv = sourceMatrix
89
+ ? createTransformFromCoordinateTransform((input) =>
90
+ applyMatrix(
91
+ sourceMatrix,
92
+ transform(input, this.targetProj_, this.sourceProj_),
93
+ ),
94
+ )
95
+ : getTransform(this.targetProj_, this.sourceProj_);
82
96
 
83
97
  /**
84
98
  * @param {import("../coordinate.js").Coordinate} c A coordinate.
@@ -202,6 +202,11 @@ declare class DataTileSource<TileType extends import("../Tile.js").default = Dat
202
202
  * @type {CrossOriginAttribute}
203
203
  */
204
204
  private crossOrigin_;
205
+ /**
206
+ * @protected
207
+ * @type {import("../transform.js").Transform}
208
+ */
209
+ protected transformMatrix: import("../transform.js").Transform;
205
210
  /**
206
211
  * Set the source tile sizes. The length of the array is expected to match the number of
207
212
  * levels in the tile grid.
@@ -231,6 +236,16 @@ declare class DataTileSource<TileType extends import("../Tile.js").default = Dat
231
236
  * @return {!TileType} Tile.
232
237
  */
233
238
  getReprojTile_(z: number, x: number, y: number, targetProj: import("../proj/Projection.js").default, sourceProj: import("../proj/Projection.js").default): TileType;
239
+ /**
240
+ * @param {number} z Tile coordinate z.
241
+ * @param {number} x Tile coordinate x.
242
+ * @param {number} y Tile coordinate y.
243
+ * @param {number} pixelRatio Pixel ratio.
244
+ * @param {import("../proj/Projection.js").default} [projection] Projection.
245
+ * @return {TileType|null} Tile (or null if outside source extent).
246
+ * @override
247
+ */
248
+ override getTile(z: number, x: number, y: number, pixelRatio: number, projection?: import("../proj.js").Projection | undefined): TileType | null;
234
249
  /**
235
250
  * Sets the tile grid to use when reprojecting the tiles to the given
236
251
  * projection instead of the default tile grid for the projection.
@@ -1 +1 @@
1
- {"version":3,"file":"DataTile.d.ts","sourceRoot":"","sources":["DataTile.js"],"names":[],"mappings":";mCAoBa,WAAW,GAAC,iBAAiB;;;;;YAK5B,WAAW;;;;;;;;;;;;;;;qBASZ,CAAS,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,EAAE,IAA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OAOG;IACH,kBAPW,MAAM,KACN,MAAM,KACN,MAAM,cACN,OAAO,uBAAuB,EAAE,OAAO,cACvC,OAAO,uBAAuB,EAAE,OAAO,GACrC,QAAQ,CA6CpB;IAED;;;;;;;;OAQG;IACH,oBARW,MAAM,KACN,MAAM,KACN,MAAM,cACN,MAAM,6DAEL,QAAQ,GAAC,IAAI,CAiExB;IAmDD;;;;;;;;;;;OAWG;IACH,qCAJW,OAAO,YAAY,EAAE,cAAc,YACnC,OAAO,yBAAyB,EAAE,OAAO,QAWnD;CACF;qBA7ZoB,gBAAgB;uBAIK,WAAW"}
@@ -157,6 +157,12 @@ class DataTileSource extends TileSource {
157
157
  * @type {CrossOriginAttribute}
158
158
  */
159
159
  this.crossOrigin_ = options.crossOrigin || 'anonymous';
160
+
161
+ /**
162
+ * @protected
163
+ * @type {import("../transform.js").Transform}
164
+ */
165
+ this.transformMatrix = null;
160
166
  }
161
167
 
162
168
  /**
@@ -194,7 +200,10 @@ class DataTileSource extends TileSource {
194
200
  */
195
201
  getGutterForProjection(projection) {
196
202
  const thisProj = this.getProjection();
197
- if (!thisProj || equivalent(thisProj, projection)) {
203
+ if (
204
+ (!thisProj || equivalent(thisProj, projection)) &&
205
+ !this.transformMatrix
206
+ ) {
198
207
  return this.gutter_;
199
208
  }
200
209
 
@@ -218,11 +227,12 @@ class DataTileSource extends TileSource {
218
227
  * @return {!TileType} Tile.
219
228
  */
220
229
  getReprojTile_(z, x, y, targetProj, sourceProj) {
221
- const tileGrid = this.getTileGrid();
230
+ const sourceTileGrid =
231
+ this.tileGrid || this.getTileGridForProjection(sourceProj || targetProj);
222
232
  const reprojTilePixelRatio = Math.max.apply(
223
233
  null,
224
- tileGrid.getResolutions().map((r, z) => {
225
- const tileSize = toSize(tileGrid.getTileSize(z));
234
+ sourceTileGrid.getResolutions().map((r, z) => {
235
+ const tileSize = toSize(sourceTileGrid.getTileSize(z));
226
236
  const textureSize = this.getTileSize(z);
227
237
  return Math.max(
228
238
  textureSize[0] / tileSize[0],
@@ -231,7 +241,6 @@ class DataTileSource extends TileSource {
231
241
  }),
232
242
  );
233
243
 
234
- const sourceTileGrid = this.getTileGridForProjection(sourceProj);
235
244
  const targetTileGrid = this.getTileGridForProjection(targetProj);
236
245
  const tileCoord = [z, x, y];
237
246
  const wrappedTileCoord = this.getTileCoordForTileUrlFunction(
@@ -241,16 +250,17 @@ class DataTileSource extends TileSource {
241
250
 
242
251
  const options = Object.assign(
243
252
  {
244
- sourceProj,
253
+ sourceProj: sourceProj || targetProj,
245
254
  sourceTileGrid,
246
255
  targetProj,
247
256
  targetTileGrid,
248
257
  tileCoord,
249
258
  wrappedTileCoord,
250
259
  pixelRatio: reprojTilePixelRatio,
251
- gutter: this.getGutterForProjection(sourceProj),
260
+ gutter: this.gutter_,
252
261
  getTileFunction: (z, x, y, pixelRatio) =>
253
- this.getTile(z, x, y, pixelRatio, sourceProj),
262
+ this.getTile(z, x, y, pixelRatio),
263
+ transformMatrix: this.transformMatrix,
254
264
  },
255
265
  /** @type {import("../reproj/DataTile.js").Options} */ (this.tileOptions),
256
266
  );
@@ -266,16 +276,16 @@ class DataTileSource extends TileSource {
266
276
  * @param {number} x Tile coordinate x.
267
277
  * @param {number} y Tile coordinate y.
268
278
  * @param {number} pixelRatio Pixel ratio.
269
- * @param {import("../proj/Projection.js").default} projection Projection.
279
+ * @param {import("../proj/Projection.js").default} [projection] Projection.
270
280
  * @return {TileType|null} Tile (or null if outside source extent).
271
281
  * @override
272
282
  */
273
283
  getTile(z, x, y, pixelRatio, projection) {
274
284
  const sourceProjection = this.getProjection();
275
285
  if (
276
- sourceProjection &&
277
286
  projection &&
278
- !equivalent(sourceProjection, projection)
287
+ ((sourceProjection && !equivalent(sourceProjection, projection)) ||
288
+ this.transformMatrix)
279
289
  ) {
280
290
  return this.getReprojTile_(z, x, y, projection, sourceProjection);
281
291
  }
@@ -367,7 +377,11 @@ class DataTileSource extends TileSource {
367
377
  */
368
378
  getTileGridForProjection(projection) {
369
379
  const thisProj = this.getProjection();
370
- if (this.tileGrid && (!thisProj || equivalent(thisProj, projection))) {
380
+ if (
381
+ this.tileGrid &&
382
+ (!thisProj || equivalent(thisProj, projection)) &&
383
+ !this.transformMatrix
384
+ ) {
371
385
  return this.tileGrid;
372
386
  }
373
387
 
@@ -308,6 +308,13 @@ declare class GeoTIFFSource extends DataTile<import("../DataTile.js").default> {
308
308
  * from a single GeoTIFF.
309
309
  */
310
310
  determineProjection(sources: Array<Array<GeoTIFFImage>>): void;
311
+ /**
312
+ * Determine any transform matrix for the images in this GeoTIFF.
313
+ *
314
+ * @param {Array<Array<GeoTIFFImage>>} sources Each source is a list of images
315
+ * from a single GeoTIFF.
316
+ */
317
+ determineTransformMatrix(sources: Array<Array<GeoTIFFImage>>): void;
311
318
  /**
312
319
  * Configure the tile grid based on images within the source GeoTIFFs. Each GeoTIFF
313
320
  * must have the same internal tiled structure.
@@ -1 +1 @@
1
- {"version":3,"file":"GeoTIFF.d.ts","sourceRoot":"","sources":["GeoTIFF.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAoFc,MAAM;;;;wBACN,MAAM;;;;4BACN,MAAM;;;;6BACN,MAAM;;;;6BACN,MAAM;;;;0BACN,MAAM;;;;2BACN,MAAM;;;;2BACN,MAAM;;sBAIP,OAAO,SAAS,EAAE,OAAO;2BAIzB,OAAO,SAAS,EAAE,YAAY;;;;;wBAK7B,MAAM;;;;wBACN,MAAM;;2BASP,OAAO,SAAS,EAAE,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAqO7B,KAAK,CAAC,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;iBAiBjB,OAAO,YAAY,EAAE,cAAc;;;;;;;;;;;;;;;;AAjCjD;;;;;;;;;;;;GAYG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;;;;;;GAOG;AACH;IACE;;OAEG;IAC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H;;;;;;;GAOG;AACH;IACE;;OAEG;IACH,qBAFW,OAAO,EAyGjB;IA7FC;;;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;;;OAGG;IACH,sBAAkD;IAuBpD;;;;;;;;;;;OAWG;IACH,YAXY,KAAK,CAahB;IAED;;;;;;;;OAQG;IACH,6BAHW,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,QAapC;IAED;;;;;OAKG;IACH,kCAHW,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,QA8BpC;IAED;;;;;;OAMG;IACH,mBAkPC;IAED;;;;;;;OAOG;IACH,kBA8EC;IAED;;;;;OAKG;IACH,qBA4GC;CACF;qBAx/BoB,eAAe"}
package/source/GeoTIFF.js CHANGED
@@ -12,12 +12,19 @@ import {
12
12
  } from 'geotiff';
13
13
  import {
14
14
  Projection,
15
+ createTransformFromCoordinateTransform,
15
16
  get as getCachedProjection,
16
17
  toUserCoordinate,
17
18
  toUserExtent,
18
19
  } from '../proj.js';
20
+ import {
21
+ apply as applyMatrix,
22
+ create as createMatrix,
23
+ makeInverse,
24
+ multiply as multiplyTransform,
25
+ } from '../transform.js';
26
+ import {applyTransform, getCenter, getIntersection} from '../extent.js';
19
27
  import {clamp} from '../math.js';
20
- import {getCenter, getIntersection} from '../extent.js';
21
28
  import {error as logError} from '../console.js';
22
29
  import {fromCode as unitsFromCode} from '../proj/Units.js';
23
30
 
@@ -131,7 +138,7 @@ function getWorkerPool() {
131
138
  */
132
139
  function getBoundingBox(image) {
133
140
  try {
134
- return image.getBoundingBox();
141
+ return image.getBoundingBox(true);
135
142
  } catch (_) {
136
143
  return [0, 0, image.getWidth(), image.getHeight()];
137
144
  }
@@ -521,6 +528,41 @@ class GeoTIFFSource extends DataTile {
521
528
  }
522
529
  }
523
530
 
531
+ /**
532
+ * Determine any transform matrix for the images in this GeoTIFF.
533
+ *
534
+ * @param {Array<Array<GeoTIFFImage>>} sources Each source is a list of images
535
+ * from a single GeoTIFF.
536
+ */
537
+ determineTransformMatrix(sources) {
538
+ const firstSource = sources[0];
539
+ for (let i = firstSource.length - 1; i >= 0; --i) {
540
+ const image = firstSource[i];
541
+ const modelTransformation = image.fileDirectory.ModelTransformation;
542
+ if (modelTransformation) {
543
+ // eslint-disable-next-line no-unused-vars
544
+ const [a, b, c, d, e, f, g, h] = modelTransformation;
545
+ const matrix = multiplyTransform(
546
+ multiplyTransform(
547
+ [
548
+ 1 / Math.sqrt(a * a + e * e),
549
+ 0,
550
+ 0,
551
+ -1 / Math.sqrt(b * b + f * f),
552
+ d,
553
+ h,
554
+ ],
555
+ [a, e, b, f, 0, 0],
556
+ ),
557
+ [1, 0, 0, 1, -d, -h],
558
+ );
559
+ this.transformMatrix = matrix;
560
+ this.addAlpha_ = true;
561
+ break;
562
+ }
563
+ }
564
+ }
565
+
524
566
  /**
525
567
  * Configure the tile grid based on images within the source GeoTIFFs. Each GeoTIFF
526
568
  * must have the same internal tiled structure.
@@ -685,6 +727,7 @@ class GeoTIFFSource extends DataTile {
685
727
  if (!this.getProjection()) {
686
728
  this.determineProjection(sources);
687
729
  }
730
+ this.determineTransformMatrix(sources);
688
731
 
689
732
  this.samplesPerPixel_ = samplesPerPixel;
690
733
  this.nodataValues_ = nodataValues;
@@ -752,12 +795,21 @@ class GeoTIFFSource extends DataTile {
752
795
  resolutions = [resolutions[0] * 2, resolutions[0], resolutions[0] / 2];
753
796
  }
754
797
 
798
+ let viewExtent = extent;
799
+ if (this.transformMatrix) {
800
+ const matrix = makeInverse(createMatrix(), this.transformMatrix.slice());
801
+ const transformFn = createTransformFromCoordinateTransform((input) =>
802
+ applyMatrix(matrix, input),
803
+ );
804
+ viewExtent = applyTransform(extent, transformFn);
805
+ }
806
+
755
807
  this.viewResolver({
756
808
  showFullExtent: true,
757
809
  projection: this.projection,
758
810
  resolutions: resolutions,
759
- center: toUserCoordinate(getCenter(extent), this.projection),
760
- extent: toUserExtent(extent, this.projection),
811
+ center: toUserCoordinate(getCenter(viewExtent), this.projection),
812
+ extent: toUserExtent(viewExtent, this.projection),
761
813
  zoom: zoom,
762
814
  });
763
815
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Tile.d.ts","sourceRoot":"","sources":["Tile.js"],"names":[],"mappings":"AAuQA;;;;GAIG;AACH;IACE;;;OAGG;IACH,kBAHW,MAAM,QACN,OAAO,YAAY,EAAE,OAAO,EAWtC;IANC;;;;OAIG;IACH,MAHU,OAAO,YAAY,EAAE,OAAO,CAGtB;CAEnB;;;;;kCA7QY,MAAM,IACN,OAAO,eAAe,EAAE,WAAW,CAAC,OAAO,eAAe,EAAE,UAAU,EAAE,OAAO,oBAAoB,EAAE,OAAO,EAAE,MAAM,CAAC,GACjI,OAAW,eAAe,EAAE,WAAW,CAAC,OAAO,oBAAoB,EAAE,KAAK,EAAE,OAAO,WAAW,EAAE,WAAW,EAAE,MAAM,CAAC,GACpH,OAAW,eAAe,EAAE,WAAW,CAAC,OAAO,iBAAiB,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,CAAC,GAChH,OAAW,eAAe,EAAE,mBAAmB,CAAC,OAAO,eAAe,EAAE,UAAU,GAAC,OAAO,oBAAoB,EAAE,KAAK,GACrH,OAAa,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;iBAShD,OAAO,YAAY,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAzB/B,oBAAoB;AAUtC;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;;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  * null if no tile URL should be created for the passed `tileCoord`.
239
239
  */
240
240
  getTileCoordForTileUrlFunction(tileCoord, projection) {
241
- projection = projection !== undefined ? projection : this.getProjection();
242
- const tileGrid = this.getTileGridForProjection(projection);
243
- if (this.getWrapX() && projection.isGlobal()) {
244
- tileCoord = wrapX(tileGrid, tileCoord, projection);
241
+ const gridProjection =
242
+ projection !== undefined ? projection : this.getProjection();
243
+ const tileGrid =
244
+ projection !== undefined
245
+ ? this.getTileGridForProjection(gridProjection)
246
+ : this.tileGrid || this.getTileGridForProjection(gridProjection);
247
+ if (this.getWrapX() && gridProjection.isGlobal()) {
248
+ tileCoord = wrapX(tileGrid, tileCoord, gridProjection);
245
249
  }
246
250
  return withinExtentAndZ(tileCoord, tileGrid) ? tileCoord : null;
247
251
  }
package/util.js CHANGED
@@ -33,4 +33,4 @@ export function getUid(obj) {
33
33
  * OpenLayers version.
34
34
  * @type {string}
35
35
  */
36
- export const VERSION = '10.2.2-dev.1728459826897';
36
+ export const VERSION = '10.2.2-dev.1728582963505';