Fix navigation issue
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
This commit is contained in:
@@ -150,11 +150,11 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
||||
this.compassHeading$ = this.deviceorientationService.getCurrentCompassHeading();
|
||||
this.styles$ = this.store.select(mapReducers.selectGetStyles);
|
||||
|
||||
this.mapState$.pipe(withLatestFrom(this.queryState$)).subscribe((state) => {
|
||||
this.replaceUrl(state[0], state[1], true);
|
||||
});
|
||||
// this.mapState$.pipe(withLatestFrom(this.queryState$)).subscribe((state) => {
|
||||
// this.replaceUrl(state[0], state[1], true);
|
||||
// });
|
||||
this.query$.pipe(withLatestFrom(this.mapState$)).subscribe((state) => {
|
||||
this.replaceUrl(state[1], state[0],false);
|
||||
this.replaceUrl(state[1], state[0],this.stateSetCount == 0);
|
||||
});
|
||||
this.initCustomStyles();
|
||||
}
|
||||
@@ -210,17 +210,27 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
||||
queryStateChanged = this.lastQueryState != queryState;
|
||||
this.lastQueryState = queryState;
|
||||
}
|
||||
this.zone.run(()=> {
|
||||
if ( queryStateChanged) {
|
||||
console.debug("Query state");
|
||||
this.store.dispatch(new mapActions.SetQueryState(newQueryState));
|
||||
} else if (mapStateChanged) {
|
||||
console.debug("Map state");
|
||||
this.store.dispatch(new mapActions.SetMapState(newMapState));
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
if (mapStateChanged && queryStateChanged) {
|
||||
console.debug("Both states");
|
||||
this.store.dispatch(new mapActions.SetState(newMapState, newQueryState));
|
||||
} else if (mapStateChanged) {
|
||||
console.debug("Map state");
|
||||
this.store.dispatch(new mapActions.SetMapState(newMapState));
|
||||
} else if (queryStateChanged) {
|
||||
console.debug("Query state");
|
||||
this.store.dispatch(new mapActions.SetQueryState(newQueryState));
|
||||
}
|
||||
// if (mapStateChanged && queryStateChanged) {
|
||||
// console.debug("Both states");
|
||||
// this.store.dispatch(new mapActions.SetState(newMapState, newQueryState));
|
||||
// } else if (mapStateChanged) {
|
||||
// console.debug("Map state");
|
||||
// this.store.dispatch(new mapActions.SetMapState(newMapState));
|
||||
// } else if (queryStateChanged) {
|
||||
// console.debug("Query state");
|
||||
// this.store.dispatch(new mapActions.SetQueryState(newQueryState));
|
||||
// }
|
||||
this.stateSetCount += 1;
|
||||
});
|
||||
setTimeout(() => {
|
||||
|
Reference in New Issue
Block a user