@provoly/dashboard 1.4.48 → 1.4.49

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.
@@ -1500,6 +1500,8 @@ class WidgetMapComponent extends DataWidgetComponent {
1500
1500
  this.olZoomElement$ = new BehaviorSubject(null);
1501
1501
  this.previousLayers = [];
1502
1502
  this.layerSettingsExpandedState = {};
1503
+ this.lockZoom = false;
1504
+ this.previousUrl = '';
1503
1505
  this.DEFAULT_LAYER_GROUP = DEFAULT_LAYER_GROUP;
1504
1506
  this.getOlZoomElement();
1505
1507
  this.slides = [
@@ -1972,11 +1974,28 @@ class WidgetMapComponent extends DataWidgetComponent {
1972
1974
  .filter((l) => l instanceof TileLayer || l instanceof ImageLayer)
1973
1975
  .forEach((l) => {
1974
1976
  l.getSource().refresh();
1977
+ const source = l.getSource();
1978
+ const params = source.getParams();
1979
+ let url = source?.image_?.src_;
1980
+ const indexBBOX = url.indexOf('&BBOX');
1981
+ if (indexBBOX !== -1) {
1982
+ url = url.slice(0, indexBBOX);
1983
+ }
1984
+ if (url === this.previousUrl || this.previousUrl === '') {
1985
+ this.lockZoom = true;
1986
+ }
1987
+ else if (params && params.cql_filter.startsWith('code=')) {
1988
+ this.lockZoom = false;
1989
+ }
1990
+ this.previousUrl = url;
1975
1991
  });
1976
1992
  }
1977
1993
  setTimeout(() => {
1978
1994
  const toApplyLayers = [...layers, ...mapStyleLayer];
1979
1995
  this.map.setLayers(toApplyLayers);
1996
+ if (!this.lockZoom) {
1997
+ this.fitMapForObjects(selectedIds, extents);
1998
+ }
1980
1999
  //this.fitMapForObjects(selectedIds, extents);
1981
2000
  this.map.updateSize();
1982
2001
  this.map