Add debug logging
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Willem Dantuma
2020-04-17 08:39:48 +02:00
parent da0534e928
commit 3828db341a
3 changed files with 8 additions and 3 deletions

View File

@@ -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();