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 committed Feb 5, 2024
1 parent 8442bfe commit e10a32b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 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
4 changes: 2 additions & 2 deletions projects/test-app/src/hslayers-app/hslayers-app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -647,8 +647,8 @@ export class HslayersAppComponent {
}),
}),
opticalMap,
idwLayer,
idwVectorLayer,
// idwLayer,
// idwVectorLayer,
],
timeDisplayFormat: 'dd.MM.yyyy.',
additionalLanguages: {
Expand Down

0 comments on commit e10a32b

Please sign in to comment.