Skip to content

Commit a34f916

Browse files
committed
fix(services-map-state): test for proj.epsg and pass fitOptions
1 parent 4135591 commit a34f916

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

projects/services-map-state/src/lib/map-state.service.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ export class MapStateService {
2828
}
2929
this.lastAction.next('setState');
3030
if (state instanceof MapState) {
31-
const newState = new MapState(state.zoom, state.center, state.options, state.extent, state.nativeExtent, state.time, state.viewAngle, state.rotation, state.proj.epsg);
31+
const newState = new MapState(state.zoom, state.center, state.options, state.extent, state.nativeExtent, state.time, state.viewAngle, state.rotation, state.proj.epsg, state.proj.fitOptions);
3232
this.mapState.next(newState);
3333
} else {
3434
const stateOptions: IMapStateOptions = { ...{ notifier: 'user' }, ...state.options };
35-
const newState = new MapState(state.zoom, state.center, stateOptions, state.extent, state.nativeExtent, state.time, state.viewAngle, state.rotation, state.proj.epsg);
35+
const newState = new MapState(state.zoom, state.center, stateOptions, state.extent, state.nativeExtent, state.time, state.viewAngle, state.rotation, state.proj?.epsg, state.proj?.fitOptions);
3636
this.mapState.next(newState);
3737
}
3838
}
@@ -49,7 +49,7 @@ export class MapStateService {
4949
this.lastAction.next('setExtent');
5050
const state = this.getMapState().getValue();
5151
state.options.notifier = notifier;
52-
const newState = new MapState(state.zoom, state.center, state.options, extent, state.nativeExtent, state.time, state.viewAngle, state.rotation, state.proj.epsg);
52+
const newState = new MapState(state.zoom, state.center, state.options, extent, state.nativeExtent, state.time, state.viewAngle, state.rotation, state.proj.epsg, state.proj.fitOptions);
5353
this.mapState.next(newState);
5454
}
5555

@@ -64,7 +64,7 @@ export class MapStateService {
6464
this.lastAction.next('setNativeExtent');
6565
const state = this.getMapState().getValue();
6666
state.options.notifier = notifier;
67-
const newState = new MapState(state.zoom, state.center, state.options, state.extent, nativeExtent, state.time, state.viewAngle, state.rotation, state.proj.epsg);
67+
const newState = new MapState(state.zoom, state.center, state.options, state.extent, nativeExtent, state.time, state.viewAngle, state.rotation, state.proj.epsg, state.proj.fitOptions);
6868
this.mapState.next(newState);
6969
}
7070

@@ -96,7 +96,7 @@ export class MapStateService {
9696
this.lastAction.next('setAngle');
9797
const state = this.getMapState().getValue();
9898
state.options.notifier = notifier;
99-
const newState = new MapState(state.zoom, state.center, state.options, state.extent, state.nativeExtent, state.time, angle, state.rotation, state.proj.epsg);
99+
const newState = new MapState(state.zoom, state.center, state.options, state.extent, state.nativeExtent, state.time, angle, state.rotation, state.proj.epsg, state.proj.fitOptions);
100100
this.mapState.next(newState);
101101
}
102102

@@ -107,7 +107,7 @@ export class MapStateService {
107107
this.lastAction.next('setRotation');
108108
const state = this.getMapState().getValue();
109109
state.options.notifier = notifier;
110-
const newState = new MapState(state.zoom, state.center, state.options, state.extent, state.nativeExtent, state.time, state.viewAngle, rotation, state.proj.epsg);
110+
const newState = new MapState(state.zoom, state.center, state.options, state.extent, state.nativeExtent, state.time, state.viewAngle, rotation, state.proj.epsg, state.proj.fitOptions);
111111
this.mapState.next(newState);
112112
}
113113

0 commit comments

Comments
 (0)