Skip to content

Commit

Permalink
fix(IdentifyUtils): reproject geometry only if GetFeatureInfo respons…
Browse files Browse the repository at this point in the history
…e has CRS information
  • Loading branch information
benoitblanc committed Dec 20, 2024
1 parent ec89e54 commit 94cb47e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion utils/IdentifyUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,15 @@ const IdentifyUtils = {
if (result[layer.name] === undefined) {
result[layer.name] = [];
}
let geometry = feature.geometry;
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,
id: id,
geometry: feature.geometry,
geometry: geometry,
layername: layer.name,
layertitle: layer.title
});
Expand Down

0 comments on commit 94cb47e

Please sign in to comment.