From 3828db341ab23740e402b2d54e8ec7b63efd2190 Mon Sep 17 00:00:00 2001 From: Willem Dantuma Date: Fri, 17 Apr 2020 08:39:48 +0200 Subject: [PATCH] Add debug logging --- .../common-map/src/fm-map/components/map/map.component.ts | 8 ++++++++ projects/common-map/src/fm-map/effects/map.effects.ts | 1 - projects/common-map/src/fm-map/reducers/map.reducer.ts | 2 -- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/projects/common-map/src/fm-map/components/map/map.component.ts b/projects/common-map/src/fm-map/components/map/map.component.ts index 6099035..6bcdf9c 100644 --- a/projects/common-map/src/fm-map/components/map/map.component.ts +++ b/projects/common-map/src/fm-map/components/map/map.component.ts @@ -92,6 +92,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit { private geolocationService: GeolocationService, private zone: NgZone, private deviceorientationService:DeviceOrientationService) { + } @HostListener('document:keyup', ['$event']) @@ -127,10 +128,12 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit { } ngOnInit() { + console.debug("Init"); this.store.dispatch(new mapActions.Clear()); this.selectedFeatures$.next({x:0,y:0,features:[]}); this.selectedFeatures$.next(null); this.query$.pipe(withLatestFrom(this.mapState$),withLatestFrom(this.setStateCount$)).subscribe(([[queryState,mapState],setStateCount]) =>{ + console.debug(`Do Query ${setStateCount}`); if(setStateCount>1) { let newQueryState = tassign(mapReducers.initialQueryState); let urlparts=[]; @@ -156,11 +159,13 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit { } }); this.mapState$.pipe(withLatestFrom(this.queryState$),withLatestFrom(this.setStateCount$)).subscribe(([[mapState,queryState],setStateCount]) =>{ + console.debug(`Mapstate ${setStateCount}`); if(setStateCount>0) { this.replaceUrl(mapState,queryState,true); } }); this.queryState$.pipe(withLatestFrom(this.mapState$),withLatestFrom(this.setStateCount$)).subscribe(([[queryState,mapState],setStateCount]) =>{ + console.debug(`Querystate ${setStateCount}`); if(setStateCount>0) { this.replaceUrl(mapState,queryState,true); } @@ -187,8 +192,10 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit { } ngAfterViewInit() { + console.debug("View init"); this.initCustomStyles(); this.paramSub = this.route.paramMap.pipe(withLatestFrom(this.setStateCount$),withLatestFrom(this.queryState$),withLatestFrom(this.mapState$)).subscribe( ([[[params,setStateCount],lastQueryState],lastMapState]) => { + console.debug(`Url change ${setStateCount}`); var newMapState: IMapState = lastMapState; var newQueryState: IQueryState = lastQueryState; var hasUrlmapState = params.has("xCenter") && params.has("yCenter"); @@ -270,6 +277,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit { } handleOnMoveEnd(event) { + console.debug("Move end"); this.zone.run(() =>{ var map = event.map; var view = map.getView(); diff --git a/projects/common-map/src/fm-map/effects/map.effects.ts b/projects/common-map/src/fm-map/effects/map.effects.ts index 596f5f4..e9efd4d 100644 --- a/projects/common-map/src/fm-map/effects/map.effects.ts +++ b/projects/common-map/src/fm-map/effects/map.effects.ts @@ -113,7 +113,6 @@ export class MapEffects { startSearch$: Observable = this.actions$.pipe( ofType(mapActions.STARTSEARCH), switchMap((action: mapActions.StartSearch) => { - console.debug("Start search"); var startDate = action.queryState.startDate; var endDate = action.queryState.endDate; var newAction:Observable; diff --git a/projects/common-map/src/fm-map/reducers/map.reducer.ts b/projects/common-map/src/fm-map/reducers/map.reducer.ts index f87e03f..538f695 100644 --- a/projects/common-map/src/fm-map/reducers/map.reducer.ts +++ b/projects/common-map/src/fm-map/reducers/map.reducer.ts @@ -129,7 +129,6 @@ export function reducer(state = initialState, action: mapActions.Actions | commo let a = action as mapActions.StartSearchSuccess; let extent = state.extent; if (!action.query.bboxFilter) { - console.debug("Set extent"); extent = createEmpty(); if (extent) { for (let f of action.features) { @@ -306,7 +305,6 @@ export function reducer(state = initialState, action: mapActions.Actions | commo return tassign(state, { searchCollapsed: state.panelVisible ? false: true}); } case mapActions.SETEXTENT: { - console.debug("Set extent 2"); let a = action as mapActions.SetExtent; return tassign(state, { extent: a.extent }); }