Skip to content

Commit

Permalink
Merge pull request #225 from swisstopo/feature/asset-220-bug-polygon-…
Browse files Browse the repository at this point in the history
…selector

Feature 220: Bug - Polygon Selector öffnet Detailauswahl
  • Loading branch information
daniel-va authored Jul 22, 2024
2 parents 6067703 + f60da23 commit 14210e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ export class DrawControl extends Control {
return this._isDrawing$.asObservable();
}

get isDrawing(): boolean {
return this._isDrawing$.value;
}

setPolygon(polygon: LV95[] | null) {
this._isDrawing$.next(false);
this._polygon$.next(polygon);
Expand Down
6 changes: 4 additions & 2 deletions libs/asset-viewer/src/lib/components/map/map.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import { AppState } from '@asset-sg/client-shared';
import { ORD } from '@asset-sg/core';
import { Store } from '@ngrx/store';
import { asapScheduler, first, identity, skip, Subscription, switchMap } from 'rxjs';
import { asapScheduler, filter, first, identity, skip, Subscription, switchMap } from 'rxjs';
import { AllStudyService } from '../../services/all-study.service';
import * as searchActions from '../../state/asset-search/asset-search.actions';
import {
Expand Down Expand Up @@ -127,7 +127,9 @@ export class MapComponent implements AfterViewInit, OnChanges, OnDestroy {
this.controller.addControl(this.controls.zoom);
this.controller.addControl(this.controls.draw);

this.subscription.add(this.controller.assetsClick$.subscribe(this.assetsClick));
this.subscription.add(
this.controller.assetsClick$.pipe(filter(() => !this.controls.draw.isDrawing)).subscribe(this.assetsClick)
);
this.subscription.add(this.controller.assetsHover$.subscribe(this.assetsHover));

// Some bindings can be initialized only after the map has fully loaded,
Expand Down

0 comments on commit 14210e4

Please sign in to comment.