Skip to content

Commit

Permalink
fix: Register popUp on map
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipLeitner authored and jmacura committed Feb 13, 2024
1 parent 9a1e6e2 commit e7cfc39
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions projects/hslayers/common/query-popup/query-popup.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export class HsQueryPopupComponent
implements OnDestroy, HsDialogComponent, AfterViewInit, OnInit
{
getFeatures = getFeatures;
olMapLoadsSubscription: Subscription;
attributesForHover = [];
dialogItem?: HsDialogItem;
viewRef: ViewRef;
Expand All @@ -49,11 +48,9 @@ export class HsQueryPopupComponent
}

ngOnInit() {
this.olMapLoadsSubscription = this.hsEventBusService.olMapLoads.subscribe(
(map) => {
map.addOverlay(this.data.service.hoverPopup);
},
);
this.hsMapService.loaded().then((map) => {
map.addOverlay(this.data.service.hoverPopup);
});
this.hsQueryPopupWidgetContainerService.initWidgets(
this.hsConfig.queryPopupWidgets,
);
Expand All @@ -62,7 +59,6 @@ export class HsQueryPopupComponent
ngOnDestroy(): void {
this.hsMapService.getMap().removeOverlay(this.data.service.hoverPopup);
this.hsQueryPopupWidgetContainerService.cleanup();
this.olMapLoadsSubscription.unsubscribe();
}

/**
Expand Down

0 comments on commit e7cfc39

Please sign in to comment.