ol 7.1.1-dev.1668897187040 → 7.1.1-dev.1668961363905

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": "7.1.1-dev.1668897187040",
3
+ "version": "7.1.1-dev.1668961363905",
4
4
  "description": "OpenLayers mapping library",
5
5
  "keywords": [
6
6
  "map",
@@ -295,6 +295,16 @@ declare class GeoTIFFSource extends DataTile {
295
295
  * ```
296
296
  */
297
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;
298
308
  /**
299
309
  * Configure the tile grid based on images within the source GeoTIFFs. Each GeoTIFF
300
310
  * 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAoO7B,MAAM,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAhB/B;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;;;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
@@ -181,7 +181,10 @@ function getProjection(image) {
181
181
  return null;
182
182
  }
183
183
 
184
- if (geoKeys.ProjectedCSTypeGeoKey) {
184
+ if (
185
+ geoKeys.ProjectedCSTypeGeoKey &&
186
+ geoKeys.ProjectedCSTypeGeoKey !== 32767
187
+ ) {
185
188
  const code = 'EPSG:' + geoKeys.ProjectedCSTypeGeoKey;
186
189
  let projection = getCachedProjection(code);
187
190
  if (!projection) {
@@ -196,7 +199,7 @@ function getProjection(image) {
196
199
  return projection;
197
200
  }
198
201
 
199
- if (geoKeys.GeographicTypeGeoKey) {
202
+ if (geoKeys.GeographicTypeGeoKey && geoKeys.GeographicTypeGeoKey !== 32767) {
200
203
  const code = 'EPSG:' + geoKeys.GeographicTypeGeoKey;
201
204
  let projection = getCachedProjection(code);
202
205
  if (!projection) {
@@ -498,6 +501,27 @@ class GeoTIFFSource extends DataTile {
498
501
  return this.error_;
499
502
  }
500
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
+
501
525
  /**
502
526
  * Configure the tile grid based on images within the source GeoTIFFs. Each GeoTIFF
503
527
  * must have the same internal tiled structure.
@@ -660,15 +684,7 @@ class GeoTIFFSource extends DataTile {
660
684
  }
661
685
 
662
686
  if (!this.getProjection()) {
663
- const firstSource = sources[0];
664
- for (let i = firstSource.length - 1; i >= 0; --i) {
665
- const image = firstSource[i];
666
- const projection = getProjection(image);
667
- if (projection) {
668
- this.projection = projection;
669
- break;
670
- }
671
- }
687
+ this.determineProjection(sources);
672
688
  }
673
689
 
674
690
  this.samplesPerPixel_ = samplesPerPixel;
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 = '7.1.1-dev.1668897187040';
36
+ export const VERSION = '7.1.1-dev.1668961363905';