Fix setExtent
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good Details

2022.01
Willem Dantuma 2021-04-19 08:43:20 +02:00
parent 0485c163ad
commit dcc24aa149
1 changed files with 8 additions and 7 deletions

View File

@ -154,14 +154,15 @@ export class MapEffects {
@Effect()
zoomToExtent2$: Observable<Action> = this.actions$.pipe(
ofType(mapActions.SETFEATURES),
map((action: mapActions.SetFeatures) => {
switchMap((action: mapActions.SetFeatures) => {
let extent = createEmpty();
if (extent) {
for (let f of action.features) {
extend(extent, (f as Feature).getGeometry().getExtent());
}
}
return new mapActions.SetExtent(extent);
if (extent) {
for (let f of action.features) {
extend(extent, (f as Feature).getGeometry().getExtent());
}
if(action.features.length>0) return of(new mapActions.SetExtent(extent));
}
return EMPTY;
}));
@Effect()