Add debug logging
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good Details

feature/MinimizeSolution
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();

View File

@ -113,7 +113,6 @@ export class MapEffects {
startSearch$: Observable<Action> = this.actions$.pipe(
ofType(mapActions.STARTSEARCH),
switchMap((action: mapActions.StartSearch) => {
console.debug("Start search");
var startDate = action.queryState.startDate;
var endDate = action.queryState.endDate;
var newAction:Observable<Action>;

View File

@ -129,7 +129,6 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
let a = action as mapActions.StartSearchSuccess;
let extent = state.extent;
if (!action.query.bboxFilter) {
console.debug("Set extent");
extent = createEmpty();
if (extent) {
for (let f of action.features) {
@ -306,7 +305,6 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
return tassign(state, { searchCollapsed: state.panelVisible ? false: true});
}
case mapActions.SETEXTENT: {
console.debug("Set extent 2");
let a = action as mapActions.SetExtent;
return tassign(state, { extent: a.extent });
}