@regionerne/gis-komponent 0.0.80 → 0.0.81

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.
@@ -22,7 +22,7 @@ import { register } from 'ol/proj/proj4';
22
22
  import proj4 from 'proj4';
23
23
  import { Control, Rotate as Rotate$1 } from 'ol/control';
24
24
  import { TileWMS, Vector } from 'ol/source';
25
- import { Subject, BehaviorSubject, tap, switchMap, EMPTY, map, combineLatest, Observable, debounceTime, distinctUntilChanged, of, ReplaySubject, filter, interval, forkJoin, catchError, throwError } from 'rxjs';
25
+ import { Subject, BehaviorSubject, tap, switchMap, EMPTY, map, combineLatest, Observable, debounceTime, distinctUntilChanged, filter, take, of, ReplaySubject, interval, forkJoin, catchError, throwError } from 'rxjs';
26
26
  import WMTS, { optionsFromCapabilities } from 'ol/source/WMTS';
27
27
  import VectorLayer from 'ol/layer/Vector';
28
28
  import TileSource from 'ol/source/Tile';
@@ -283,6 +283,7 @@ class LayerHelperService {
283
283
  _dmpLayersCacheStoragKey = 'dmpLayersCache';
284
284
  _layerErrorService = inject(LayerErrorService);
285
285
  layerActivatedByBackgroundGroup = new Subject();
286
+ layersAddedToMapSubject = new BehaviorSubject(false);
286
287
  setDbId(layer, id) {
287
288
  layer.set(this._layerDbIdKey, id);
288
289
  }
@@ -934,7 +935,6 @@ class LayerSelectorComponent {
934
935
  else {
935
936
  this._loadPosition(this.collapsed);
936
937
  this.filteredLayerGroups = cachedProfileInfo.cachedLayerGroups.filter(gr => !gr.background);
937
- ;
938
938
  this.filteredBackgroundLayerGroups = cachedProfileInfo.cachedLayerGroups.filter(gr => gr.background);
939
939
  this._setVisibleLayersFromCache(cachedProfileInfo.cachedLayerGroups);
940
940
  }
@@ -964,7 +964,7 @@ class LayerSelectorComponent {
964
964
  group.layers.forEach(layer => layer.visible = false); //Turn all layers off in selector to begin with
965
965
  group.visible = true; // Expand the group (there will be at least one active layer)
966
966
  group.expanded = true;
967
- this.map?.once('rendercomplete', () => this._layerHelper.startFailoverForBackgroundGroup(this.map, group.id));
967
+ this._layerHelper.layersAddedToMapSubject.pipe(filter(added => added === true), take(1)).subscribe((added) => this._layerHelper.startFailoverForBackgroundGroup(this.map, group.id));
968
968
  });
969
969
  this._initializeMapControl();
970
970
  }
@@ -5421,6 +5421,7 @@ class GisKomponentComponent {
5421
5421
  }))
5422
5422
  ];
5423
5423
  this.map.setLayers(layers);
5424
+ this._layerHelper.layersAddedToMapSubject.next(true);
5424
5425
  if (this.settings) {
5425
5426
  this._featureLoader.loadFeaturesSettings(this.settings);
5426
5427
  }