Skip to content

Commit

Permalink
Map viewer / ESRIREST layers / Scale the layer extent to show the sym…
Browse files Browse the repository at this point in the history
…bology of the features in the corners of the extent. (#8027)

Fixes #8025
  • Loading branch information
josegar74 committed May 14, 2024
1 parent c8bc70f commit a79641b
Showing 1 changed file with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1835,13 +1835,25 @@
.then(function (results) {
var layerInfo = results[0];
var legendUrl = results[1];

var layerExtent;

// Scale the layer extent. See https://github.com/geonetwork/core-geonetwork/issues/8025
if (layerInfo.extent) {
layerExtent = [
layerInfo.extent.xmin,
layerInfo.extent.ymin,
layerInfo.extent.xmax,
layerInfo.extent.ymax
];

var geomExtent = ol.geom.Polygon.fromExtent(layerExtent);
geomExtent.scale(1.1);
layerExtent = geomExtent.getExtent();
}

var extent = layerInfo.extent
? [
layerInfo.extent.xmin,
layerInfo.extent.ymin,
layerInfo.extent.xmax,
layerInfo.extent.ymax
]
? layerExtent
: map.getView().calculateExtent();
if (
layerInfo.extent &&
Expand Down

0 comments on commit a79641b

Please sign in to comment.