Fix zone
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good

This commit is contained in:
Willem Dantuma 2020-01-03 15:00:11 +01:00
parent 867fdc3fcc
commit 41d55110ea

View File

@ -1,4 +1,4 @@
import { Component, OnInit, OnDestroy, HostListener, Inject, ViewChild, AfterViewInit,ChangeDetectorRef } from '@angular/core'; import { Component, OnInit, OnDestroy, HostListener, Inject, ViewChild, AfterViewInit,ChangeDetectorRef,NgZone } from '@angular/core';
import { Location } from '@angular/common'; import { Location } from '@angular/common';
import { Observable, Subject, Subscription,combineLatest, from } from 'rxjs'; import { Observable, Subject, Subscription,combineLatest, from } from 'rxjs';
import { debounce, withLatestFrom, first, combineAll } from 'rxjs/operators'; import { debounce, withLatestFrom, first, combineAll } from 'rxjs/operators';
@ -81,7 +81,8 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
private serializeService: StateSerializerService, private serializeService: StateSerializerService,
public itemTypeService: ItemTypeService, public itemTypeService: ItemTypeService,
private location: Location, private location: Location,
private geolocationService: GeolocationService) { private geolocationService: GeolocationService,
private zone: NgZone) {
} }
@HostListener('document:keyup', ['$event']) @HostListener('document:keyup', ['$event'])
@ -248,6 +249,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
} }
handleOnMoveEnd(event) { handleOnMoveEnd(event) {
this.zone.run(() =>{
var map = event.map; var map = event.map;
var view = map.getView(); var view = map.getView();
var rotation = view.getRotation(); var rotation = view.getRotation();
@ -264,10 +266,13 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
this.store.dispatch(new mapActions.SetViewExtent(state.extent)); this.store.dispatch(new mapActions.SetViewExtent(state.extent));
} }
}); });
});
} }
handleOnMouseDown(event: MouseEvent) { handleOnMouseDown(event: MouseEvent) {
this.zone.run(() =>{
this.store.dispatch(new mapActions.CollapseSearch()); this.store.dispatch(new mapActions.CollapseSearch());
});
} }
handleOnDownload(event) { handleOnDownload(event) {