Add debug logging
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
parent
da0534e928
commit
3828db341a
@ -92,6 +92,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
|||||||
private geolocationService: GeolocationService,
|
private geolocationService: GeolocationService,
|
||||||
private zone: NgZone,
|
private zone: NgZone,
|
||||||
private deviceorientationService:DeviceOrientationService) {
|
private deviceorientationService:DeviceOrientationService) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@HostListener('document:keyup', ['$event'])
|
@HostListener('document:keyup', ['$event'])
|
||||||
@ -127,10 +128,12 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
console.debug("Init");
|
||||||
this.store.dispatch(new mapActions.Clear());
|
this.store.dispatch(new mapActions.Clear());
|
||||||
this.selectedFeatures$.next({x:0,y:0,features:[]});
|
this.selectedFeatures$.next({x:0,y:0,features:[]});
|
||||||
this.selectedFeatures$.next(null);
|
this.selectedFeatures$.next(null);
|
||||||
this.query$.pipe(withLatestFrom(this.mapState$),withLatestFrom(this.setStateCount$)).subscribe(([[queryState,mapState],setStateCount]) =>{
|
this.query$.pipe(withLatestFrom(this.mapState$),withLatestFrom(this.setStateCount$)).subscribe(([[queryState,mapState],setStateCount]) =>{
|
||||||
|
console.debug(`Do Query ${setStateCount}`);
|
||||||
if(setStateCount>1) {
|
if(setStateCount>1) {
|
||||||
let newQueryState = tassign(mapReducers.initialQueryState);
|
let newQueryState = tassign(mapReducers.initialQueryState);
|
||||||
let urlparts=[];
|
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]) =>{
|
this.mapState$.pipe(withLatestFrom(this.queryState$),withLatestFrom(this.setStateCount$)).subscribe(([[mapState,queryState],setStateCount]) =>{
|
||||||
|
console.debug(`Mapstate ${setStateCount}`);
|
||||||
if(setStateCount>0) {
|
if(setStateCount>0) {
|
||||||
this.replaceUrl(mapState,queryState,true);
|
this.replaceUrl(mapState,queryState,true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.queryState$.pipe(withLatestFrom(this.mapState$),withLatestFrom(this.setStateCount$)).subscribe(([[queryState,mapState],setStateCount]) =>{
|
this.queryState$.pipe(withLatestFrom(this.mapState$),withLatestFrom(this.setStateCount$)).subscribe(([[queryState,mapState],setStateCount]) =>{
|
||||||
|
console.debug(`Querystate ${setStateCount}`);
|
||||||
if(setStateCount>0) {
|
if(setStateCount>0) {
|
||||||
this.replaceUrl(mapState,queryState,true);
|
this.replaceUrl(mapState,queryState,true);
|
||||||
}
|
}
|
||||||
@ -187,8 +192,10 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
|
console.debug("View init");
|
||||||
this.initCustomStyles();
|
this.initCustomStyles();
|
||||||
this.paramSub = this.route.paramMap.pipe(withLatestFrom(this.setStateCount$),withLatestFrom(this.queryState$),withLatestFrom(this.mapState$)).subscribe( ([[[params,setStateCount],lastQueryState],lastMapState]) => {
|
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 newMapState: IMapState = lastMapState;
|
||||||
var newQueryState: IQueryState = lastQueryState;
|
var newQueryState: IQueryState = lastQueryState;
|
||||||
var hasUrlmapState = params.has("xCenter") && params.has("yCenter");
|
var hasUrlmapState = params.has("xCenter") && params.has("yCenter");
|
||||||
@ -270,6 +277,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleOnMoveEnd(event) {
|
handleOnMoveEnd(event) {
|
||||||
|
console.debug("Move end");
|
||||||
this.zone.run(() =>{
|
this.zone.run(() =>{
|
||||||
var map = event.map;
|
var map = event.map;
|
||||||
var view = map.getView();
|
var view = map.getView();
|
||||||
|
@ -113,7 +113,6 @@ export class MapEffects {
|
|||||||
startSearch$: Observable<Action> = this.actions$.pipe(
|
startSearch$: Observable<Action> = this.actions$.pipe(
|
||||||
ofType(mapActions.STARTSEARCH),
|
ofType(mapActions.STARTSEARCH),
|
||||||
switchMap((action: mapActions.StartSearch) => {
|
switchMap((action: mapActions.StartSearch) => {
|
||||||
console.debug("Start search");
|
|
||||||
var startDate = action.queryState.startDate;
|
var startDate = action.queryState.startDate;
|
||||||
var endDate = action.queryState.endDate;
|
var endDate = action.queryState.endDate;
|
||||||
var newAction:Observable<Action>;
|
var newAction:Observable<Action>;
|
||||||
|
@ -129,7 +129,6 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
|
|||||||
let a = action as mapActions.StartSearchSuccess;
|
let a = action as mapActions.StartSearchSuccess;
|
||||||
let extent = state.extent;
|
let extent = state.extent;
|
||||||
if (!action.query.bboxFilter) {
|
if (!action.query.bboxFilter) {
|
||||||
console.debug("Set extent");
|
|
||||||
extent = createEmpty();
|
extent = createEmpty();
|
||||||
if (extent) {
|
if (extent) {
|
||||||
for (let f of action.features) {
|
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});
|
return tassign(state, { searchCollapsed: state.panelVisible ? false: true});
|
||||||
}
|
}
|
||||||
case mapActions.SETEXTENT: {
|
case mapActions.SETEXTENT: {
|
||||||
console.debug("Set extent 2");
|
|
||||||
let a = action as mapActions.SetExtent;
|
let a = action as mapActions.SetExtent;
|
||||||
return tassign(state, { extent: a.extent });
|
return tassign(state, { extent: a.extent });
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user