From 0c4e5c016a75d08b5c82e493e23e014d23b71cff Mon Sep 17 00:00:00 2001 From: volterra79 Date: Thu, 1 Feb 2024 09:57:38 +0100 Subject: [PATCH] :bug: Backport https://github.com/g3w-suite/g3w-client/pull/558 --- src/app/g3w-ol/controls/geocodingcontrol.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/g3w-ol/controls/geocodingcontrol.js b/src/app/g3w-ol/controls/geocodingcontrol.js index 752923226..5c7659e3b 100644 --- a/src/app/g3w-ol/controls/geocodingcontrol.js +++ b/src/app/g3w-ol/controls/geocodingcontrol.js @@ -585,12 +585,13 @@ function GeocodingControl(options={}) { if (q) { const [x, y, epsg] = q.split(','); coordinates = isNumber(1*x) && isNumber(1*y) ? [1*x, 1*y] : null; + const projection = epsg && await Projections.registerProjection(`EPSG:${epsg.trim()}`); try { /** * check if is sett epsg code and if is register on project */ - if (epsg && Projections.get(`EPSG:${epsg.trim()}`)) { - coordinates = ol.proj.transform(coordinates, Projections.get(`EPSG:${epsg.trim()}`), 'EPSG:4326'); + if (projection) { + coordinates = ol.proj.transform(coordinates, projection.getCode(), 'EPSG:4326'); transform = true; } } catch(err){}