From 2d285eaba04c2038c89ae8a46869a7395bdb7198 Mon Sep 17 00:00:00 2001 From: Willem Dantuma Date: Mon, 1 Feb 2021 08:43:33 +0100 Subject: [PATCH] Fix device change detection --- .../common-map/src/fm-map/components/map/map.component.html | 2 +- .../common-map/src/fm-map/components/map/map.component.ts | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/projects/common-map/src/fm-map/components/map/map.component.html b/projects/common-map/src/fm-map/components/map/map.component.html index 39db40b..9cea51e 100644 --- a/projects/common-map/src/fm-map/components/map/map.component.html +++ b/projects/common-map/src/fm-map/components/map/map.component.html @@ -39,7 +39,7 @@ - +
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 ca578cc..e1fb671 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 @@ -84,8 +84,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit { private lastUrl = ""; private initialized: boolean = false; public noContent: boolean = false; - public isMobile = true; - + @ViewChild('map') map; @ViewChild('contentDiv') contentDiv: ElementRef; @@ -99,7 +98,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit { private geolocationService: GeolocationService, private zone: NgZone, private deviceorientationService:DeviceOrientationService, - private devicesService:DeviceService) { + public devicesService:DeviceService) { this.querySub = this.query$.pipe(skip(1), withLatestFrom(this.mapState$)).subscribe(([queryState,mapState]) =>{ if(queryState) { let newQueryState = tassign(mapReducers.initialQueryState); @@ -174,7 +173,6 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit { this.store.dispatch(new mapActions.Clear()); this.selectedFeatures$.next({x:0,y:0,features:[]}); this.selectedFeatures$.next(null); - this.isMobile = this.devicesService.IsMobile(); } initCustomStyles() {