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:
@@ -10,6 +10,7 @@ import {commonActions} from '@farmmaps/common';
|
||||
import { createSelector, createFeatureSelector } from '@ngrx/store';
|
||||
|
||||
import {Feature} from 'ol';
|
||||
import { createEmpty, extend} from 'ol/extent';
|
||||
|
||||
import { ROUTER_NAVIGATION, RouterNavigationAction } from '@ngrx/router-store';
|
||||
|
||||
@@ -124,11 +125,21 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
|
||||
}
|
||||
case mapActions.STARTSEARCHSUCCESS: {
|
||||
let a = action as mapActions.StartSearchSuccess;
|
||||
let extent = state.extent;
|
||||
if (action.query.bboxFilter) {
|
||||
extent = createEmpty();
|
||||
if (extent) {
|
||||
for (let f of action.features) {
|
||||
extend(extent, (f as Feature).getGeometry().getExtent());
|
||||
}
|
||||
}
|
||||
}
|
||||
return tassign(state, {
|
||||
panelVisible: true,
|
||||
clearEnabled: true,
|
||||
searchMinified: true,
|
||||
features: a.features
|
||||
features: a.features,
|
||||
extent:extent
|
||||
});
|
||||
}
|
||||
case mapActions.SELECTFEATURE: {
|
||||
|
Reference in New Issue
Block a user