Skip to content

Commit

Permalink
Honour CRS information in GetFeatureInfo response (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitblanc authored Dec 20, 2024
1 parent d8d07ad commit 56b3ccb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions utils/IdentifyUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 56b3ccb

Please sign in to comment.