From eaa87e8d8f13df8b7befb6dd8fc3a5a133b82336 Mon Sep 17 00:00:00 2001 From: mike-000 <49240900+mike-000@users.noreply.github.com> Date: Mon, 11 Apr 2022 23:42:27 +0100 Subject: [PATCH 1/2] do not assert null projection --- src/ol/source/Tile.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ol/source/Tile.js b/src/ol/source/Tile.js index b09e812d4c..3467ea1e6b 100644 --- a/src/ol/source/Tile.js +++ b/src/ol/source/Tile.js @@ -281,8 +281,9 @@ class TileSource extends Source { * @protected */ getTileCacheForProjection(projection) { + const sourceProjection = this.getProjection(); assert( - equivalent(this.getProjection(), projection), + sourceProjection === null || equivalent(sourceProjection, projection), 68 // A VectorTile source can only be rendered if it has a projection compatible with the view projection. ); return this.tileCache; From e8257f1bb36488cf970ee0774dae9196d54bfc69 Mon Sep 17 00:00:00 2001 From: mike-000 <49240900+mike-000@users.noreply.github.com> Date: Tue, 12 Apr 2022 16:22:25 +0100 Subject: [PATCH 2/2] projection may be null --- src/ol/source/Source.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ol/source/Source.js b/src/ol/source/Source.js index 3176868b90..0f53d1c06e 100644 --- a/src/ol/source/Source.js +++ b/src/ol/source/Source.js @@ -54,7 +54,7 @@ class Source extends BaseObject { /** * @protected - * @type {import("../proj/Projection.js").default} + * @type {import("../proj/Projection.js").default|null} */ this.projection = getProjection(options.projection); @@ -141,7 +141,7 @@ class Source extends BaseObject { /** * Get the projection of the source. - * @return {import("../proj/Projection.js").default} Projection. + * @return {import("../proj/Projection.js").default|null} Projection. * @api */ getProjection() {