From c341b3e42f3273a2ec5431af30aa5eb55b5d245e Mon Sep 17 00:00:00 2001 From: Willem Dantuma Date: Fri, 21 Feb 2020 00:51:10 +0100 Subject: [PATCH] Another attemt to fix zooming --- .../common-map/src/fm-map/components/map/map.component.ts | 8 +++++--- 1 file changed, 5 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 d930161..696bf6b 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 @@ -130,7 +130,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit { this.selectedFeatures$.next(null); this.query$.pipe(withLatestFrom(this.mapState$),withLatestFrom(this.setStateCount$)).subscribe((state) => { if(state[1]>0) this.replaceUrl(state[0][1], state[0][0],false); - }); + }); } initCustomStyles() { @@ -182,6 +182,8 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit { } queryStateChanged = this.serializeService.serialize(lastQueryState) != queryState; } + let t =0; + if(setStateCount==0) t=600; setTimeout(() => { this.zone.run(()=> { if ( queryStateChanged && mapStateChanged) { @@ -195,12 +197,12 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit { this.store.dispatch(new mapActions.SetMapState(newMapState)); } }) - },0); + },t); }); setTimeout(() => { this.map.instance.updateSize(); }, 500); - console.debug("Afterviewinit"); + console.debug("Afterviewinit"); } handleSearchCollapse(event) {