diff --git a/projects/hslayers/common/query-popup/query-popup-base.service.ts b/projects/hslayers/common/query-popup/query-popup-base.service.ts index e222b4ce56..db8cef1f99 100644 --- a/projects/hslayers/common/query-popup/query-popup-base.service.ts +++ b/projects/hslayers/common/query-popup/query-popup-base.service.ts @@ -79,6 +79,7 @@ export class HsQueryPopupBaseService extends HsQueryPopupData { } } else { this.featuresUnderMouse = []; + this.featureLayersUnderMouse = []; } }); } @@ -88,6 +89,7 @@ export class HsQueryPopupBaseService extends HsQueryPopupData { */ closePopup(): void { this.featuresUnderMouse = []; + this.featureLayersUnderMouse = []; } /** diff --git a/projects/hslayers/common/query-popup/widgets/clear-layer.component.ts b/projects/hslayers/common/query-popup/widgets/clear-layer.component.ts index 4087739c6e..23e91dec24 100644 --- a/projects/hslayers/common/query-popup/widgets/clear-layer.component.ts +++ b/projects/hslayers/common/query-popup/widgets/clear-layer.component.ts @@ -58,6 +58,7 @@ export class HsClearLayerComponent } layer.getSource().clear(); this.data.service.featuresUnderMouse = []; + this.data.service.featureLayersUnderMouse = []; } } diff --git a/projects/hslayers/common/query-popup/widgets/feature-info.component.ts b/projects/hslayers/common/query-popup/widgets/feature-info.component.ts index eaa0478b99..301c5be788 100644 --- a/projects/hslayers/common/query-popup/widgets/feature-info.component.ts +++ b/projects/hslayers/common/query-popup/widgets/feature-info.component.ts @@ -91,6 +91,7 @@ export class HsFeatureInfoComponent if (confirmed == 'yes') { this.hsQueryVectorService.removeFeature(feature); this.data.service.featuresUnderMouse = []; + this.data.service.featureLayersUnderMouse = []; } } diff --git a/projects/hslayers/services/query/query-vector.service.ts b/projects/hslayers/services/query/query-vector.service.ts index e0f8a9c19b..339461072d 100644 --- a/projects/hslayers/services/query/query-vector.service.ts +++ b/projects/hslayers/services/query/query-vector.service.ts @@ -142,21 +142,6 @@ export class HsQueryVectorService { }); } - /** - * Get features under the mouse pointer on the map - * @param map - Current map object - * @param pixel - Target pixel - * @returns Array with features - */ - getFeaturesUnderMouse(map: Map, pixel: number[]): FeatureLike[] { - return map - .getFeaturesAtPixel(pixel) - .filter((feature: Feature) => { - const layer = this.hsMapService.getLayerForFeature(feature); - return layer && layer != this.hsQueryBaseService.queryLayer; - }); - } - /** * Get selected features original data * @param feature - Feature selected