Fix zone
FarmMaps.Develop/FarmMapsLib/develop This commit looks good Details

pull/1/head
Willem Dantuma 2020-01-03 15:00:11 +01:00
parent 867fdc3fcc
commit 41d55110ea
1 changed files with 24 additions and 19 deletions

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