@eeacms/volto-arcgis-block 0.1.440 → 0.1.441

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ ### [0.1.441](https://github.com/eea/volto-arcgis-block/compare/0.1.440...0.1.441) - 7 April 2026
8
+
7
9
  ### [0.1.440](https://github.com/eea/volto-arcgis-block/compare/0.1.439...0.1.440) - 31 March 2026
8
10
 
9
11
  ### [0.1.439](https://github.com/eea/volto-arcgis-block/compare/0.1.438...0.1.439) - 23 March 2026
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-arcgis-block",
3
- "version": "0.1.440",
3
+ "version": "0.1.441",
4
4
  "description": "volto-arcgis-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: CodeSyntax",
@@ -5857,6 +5857,53 @@ class MenuWidget extends React.Component {
5857
5857
  const serviceLayer = this.state.wmsUserServiceLayers.find(
5858
5858
  (layer) => layer.LayerId === elem.id,
5859
5859
  );
5860
+ const resolveLayerExtent = async () => {
5861
+ const activeLayer = this.layers[elem.id] || serviceLayer;
5862
+ if (!activeLayer) {
5863
+ return null;
5864
+ }
5865
+ let targetExtent =
5866
+ activeLayer.fullExtent ||
5867
+ (activeLayer.fullExtents && activeLayer.fullExtents[0]
5868
+ ? activeLayer.fullExtents[0]
5869
+ : null);
5870
+ if (!targetExtent && typeof activeLayer.queryExtent === 'function') {
5871
+ try {
5872
+ const queryResult = await activeLayer.queryExtent();
5873
+ targetExtent = queryResult?.extent || null;
5874
+ } catch (error) {}
5875
+ }
5876
+ if (!targetExtent) {
5877
+ return null;
5878
+ }
5879
+ if (!(targetExtent instanceof Extent)) {
5880
+ targetExtent = new Extent({
5881
+ xmin: targetExtent.xmin,
5882
+ ymin: targetExtent.ymin,
5883
+ xmax: targetExtent.xmax,
5884
+ ymax: targetExtent.ymax,
5885
+ spatialReference:
5886
+ targetExtent.spatialReference || this.view?.spatialReference,
5887
+ });
5888
+ }
5889
+ if (
5890
+ targetExtent?.spatialReference &&
5891
+ this.view?.spatialReference &&
5892
+ targetExtent.spatialReference.wkid !== this.view.spatialReference.wkid
5893
+ ) {
5894
+ try {
5895
+ await projection.load();
5896
+ const projectedExtent = projection.project(
5897
+ targetExtent,
5898
+ this.view.spatialReference,
5899
+ );
5900
+ if (projectedExtent) {
5901
+ targetExtent = projectedExtent;
5902
+ }
5903
+ } catch (error) {}
5904
+ }
5905
+ return targetExtent;
5906
+ };
5860
5907
 
5861
5908
  if (!serviceLayer) {
5862
5909
  this.findCheckedDataset(elem);
@@ -5864,6 +5911,27 @@ class MenuWidget extends React.Component {
5864
5911
  this.productId = null;
5865
5912
  this.url = serviceLayer.ViewService;
5866
5913
  }
5914
+ const isUploadedServiceLayer =
5915
+ !!serviceLayer &&
5916
+ (this.layers[elem.id]?.type === 'feature' ||
5917
+ serviceLayer.type === 'feature');
5918
+ if (isUploadedServiceLayer) {
5919
+ const targetExtent = await resolveLayerExtent();
5920
+ if (targetExtent) {
5921
+ this.view.goTo(targetExtent);
5922
+ this.url = null;
5923
+ return;
5924
+ }
5925
+ if (
5926
+ this.uploadedGraphics &&
5927
+ this.uploadedGraphics[elem.id] &&
5928
+ this.uploadedGraphics[elem.id].length > 0
5929
+ ) {
5930
+ this.view.goTo(this.uploadedGraphics[elem.id]);
5931
+ this.url = null;
5932
+ return;
5933
+ }
5934
+ }
5867
5935
  let BBoxes = {};
5868
5936
  let firstLayer;
5869
5937
  let myExtent = null;