Skip to content

Commit

Permalink
🐛 Backport #558
Browse files Browse the repository at this point in the history
  • Loading branch information
volterra79 committed Feb 1, 2024
1 parent 115655f commit 0c4e5c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/g3w-ol/controls/geocodingcontrol.js
Original file line number Diff line number Diff line change
Expand Up @@ -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){}
Expand Down

0 comments on commit 0c4e5c0

Please sign in to comment.