From 56b3ccb3445edf98c9523d52649eb4511305178b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Blanc?= Date: Fri, 20 Dec 2024 18:57:39 +0100 Subject: [PATCH] Honour CRS information in GetFeatureInfo response (#278) --- utils/IdentifyUtils.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/IdentifyUtils.js b/utils/IdentifyUtils.js index d24f57fc4..cab977146 100644 --- a/utils/IdentifyUtils.js +++ b/utils/IdentifyUtils.js @@ -315,8 +315,9 @@ const IdentifyUtils = { result[layer.name] = []; } let geometry = feature.geometry; - if (geometry) { - geometry = VectorLayerUtils.reprojectGeometry(geometry, "EPSG:4326", geometrycrs); // GeoJSON always wgs84 + if (geometry && response.crs) { + // Reproject geometry only if there is crs information in GetFeatureInfo response + geometry = VectorLayerUtils.reprojectGeometry(geometry, response.crs.properties?.name ?? "EPSG:4326", geometrycrs); } result[layer.name].push({ ...feature,