@regionerne/gis-komponent 0.0.81 → 0.0.82
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.
|
@@ -284,6 +284,10 @@ class LayerHelperService {
|
|
|
284
284
|
_layerErrorService = inject(LayerErrorService);
|
|
285
285
|
layerActivatedByBackgroundGroup = new Subject();
|
|
286
286
|
layersAddedToMapSubject = new BehaviorSubject(false);
|
|
287
|
+
_map;
|
|
288
|
+
set map(value) {
|
|
289
|
+
this._map = value;
|
|
290
|
+
}
|
|
287
291
|
setDbId(layer, id) {
|
|
288
292
|
layer.set(this._layerDbIdKey, id);
|
|
289
293
|
}
|
|
@@ -350,9 +354,9 @@ class LayerHelperService {
|
|
|
350
354
|
});
|
|
351
355
|
}
|
|
352
356
|
}
|
|
353
|
-
startFailoverForBackgroundGroup(
|
|
357
|
+
startFailoverForBackgroundGroup(groupId, aMap = undefined) {
|
|
354
358
|
const currentIndex$ = new BehaviorSubject(0);
|
|
355
|
-
const layergroup = aMap.getLayers().getArray()
|
|
359
|
+
const layergroup = (aMap ? aMap : this._map).getLayers().getArray()
|
|
356
360
|
.find(layergroup => layergroup instanceof OLLayerGroup && layergroup.get('id') === groupId);
|
|
357
361
|
if (!layergroup)
|
|
358
362
|
return;
|
|
@@ -964,7 +968,7 @@ class LayerSelectorComponent {
|
|
|
964
968
|
group.layers.forEach(layer => layer.visible = false); //Turn all layers off in selector to begin with
|
|
965
969
|
group.visible = true; // Expand the group (there will be at least one active layer)
|
|
966
970
|
group.expanded = true;
|
|
967
|
-
this._layerHelper.layersAddedToMapSubject.pipe(filter(added => added === true), take(1)).subscribe((added) => this._layerHelper.startFailoverForBackgroundGroup(
|
|
971
|
+
this._layerHelper.layersAddedToMapSubject.pipe(filter(added => added === true), take(1)).subscribe((added) => this._layerHelper.startFailoverForBackgroundGroup(group.id));
|
|
968
972
|
});
|
|
969
973
|
this._initializeMapControl();
|
|
970
974
|
}
|
|
@@ -1090,7 +1094,7 @@ class LayerSelectorComponent {
|
|
|
1090
1094
|
if (visible && layerGroup.background) {
|
|
1091
1095
|
//Toggle background group on, apply failover logic
|
|
1092
1096
|
layerGroup.layers.forEach(layer => layer.visible = false); // Turn all off in selector to begin with
|
|
1093
|
-
this._layerHelper.startFailoverForBackgroundGroup(
|
|
1097
|
+
this._layerHelper.startFailoverForBackgroundGroup(layerGroup.id, this.map);
|
|
1094
1098
|
}
|
|
1095
1099
|
else {
|
|
1096
1100
|
layerGroup.layers.forEach(layer => {
|
|
@@ -5427,6 +5431,7 @@ class GisKomponentComponent {
|
|
|
5427
5431
|
}
|
|
5428
5432
|
this._currentItems.map = this.map;
|
|
5429
5433
|
this._layoutService.map = this.map;
|
|
5434
|
+
this._layerHelper.map = this.map;
|
|
5430
5435
|
this._layerHelper.applyCachedLayersToDisplayInMap(this.map, profile.id);
|
|
5431
5436
|
}
|
|
5432
5437
|
});
|