Skip to content

Commit

Permalink
Register projections from lizProj4 if unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
nboisteault committed May 11, 2023
1 parent 3ccf788 commit dbb5f35
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions assets/src/modules/Lizmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ export default class Lizmap {
this._lizmap3 = lizMap;

// Register projections if unknown
for (const [ref, def] of Object.entries(lizProj4)) {
if (ref !== "" && !getProjection(ref)) {
proj4.defs(ref, def);
}
}

register(proj4);

if (!getProjection(this.projection)) {
const proj = this.config.options.projection;
proj4.defs(proj.ref, proj.proj4);
Expand All @@ -37,6 +45,7 @@ export default class Lizmap {
const proj = this.config.options.qgisProjectProjection;
proj4.defs(proj.ref, proj.proj4);
}

register(proj4);

// Override getPointResolution method to always return resolution
Expand Down

0 comments on commit dbb5f35

Please sign in to comment.