Skip to content

Commit

Permalink
refactor: Update layer position list when composition is loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipLeitner authored and jmacura committed Feb 7, 2024
1 parent cf1b319 commit f5ba9e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ export class HsCompositionsParserService {
this.hsLayoutService.setMainPanel('layermanager');
}
this.composition_edited = false;
this.hsLayerManagerService.updateLayerListPositions();
this.hsEventBusService.compositionLoads.next(responseData);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {HsConfig} from '../../config.service';
import {HsEndpoint} from '../../common/endpoints/endpoint.interface';
import {HsEventBusService} from '../core/event-bus.service';
import {HsLanguageService} from '../language/language.service';
import {HsLayerManagerService} from '../layermanager/layermanager.service';
import {HsLogService} from '../../common/log/log.service';
import {HsMapCompositionDescriptor} from './models/composition-descriptor.model';
import {HsShareUrlService} from '../permalink/share-url.service';
Expand Down Expand Up @@ -47,6 +48,7 @@ export class HsCompositionsService {
private hsCompositionsMapService: HsCompositionsMapService,
private hsEventBusService: HsEventBusService,
private hsToastService: HsToastService,
private hsLayerManagerService: HsLayerManagerService,
) {
this.hsEventBusService.compositionEdits.subscribe(() => {
this.hsCompositionsParserService.composition_edited = true;
Expand Down Expand Up @@ -374,6 +376,7 @@ export class HsCompositionsService {
this.hsMapService.addLayer(layers[i], DuplicateHandling.RemoveOriginal);
}
this.hsMapService.fitExtent(response.data.nativeExtent);
this.hsLayerManagerService.updateLayerListPositions();
} else {
this.$log.log('Error loading permalink layers');
}
Expand Down Expand Up @@ -411,6 +414,7 @@ export class HsCompositionsService {
this.hsMapService.addLayer(layers[i], DuplicateHandling.IgnoreNew);
}
localStorage.removeItem('hs_layers');
this.hsLayerManagerService.updateLayerListPositions();
}
}

Expand Down

0 comments on commit f5ba9e5

Please sign in to comment.