Fix setExtent
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
0485c163ad
commit
dcc24aa149
@ -154,14 +154,15 @@ export class MapEffects {
|
|||||||
@Effect()
|
@Effect()
|
||||||
zoomToExtent2$: Observable<Action> = this.actions$.pipe(
|
zoomToExtent2$: Observable<Action> = this.actions$.pipe(
|
||||||
ofType(mapActions.SETFEATURES),
|
ofType(mapActions.SETFEATURES),
|
||||||
map((action: mapActions.SetFeatures) => {
|
switchMap((action: mapActions.SetFeatures) => {
|
||||||
let extent = createEmpty();
|
let extent = createEmpty();
|
||||||
if (extent) {
|
if (extent) {
|
||||||
for (let f of action.features) {
|
for (let f of action.features) {
|
||||||
extend(extent, (f as Feature).getGeometry().getExtent());
|
extend(extent, (f as Feature).getGeometry().getExtent());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return new mapActions.SetExtent(extent);
|
if(action.features.length>0) return of(new mapActions.SetExtent(extent));
|
||||||
|
}
|
||||||
|
return EMPTY;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@Effect()
|
@Effect()
|
||||||
|
Loading…
Reference in New Issue
Block a user