Skip to content

Commit 6677d34

Browse files
committed
clean up js side
1 parent 80ca9dd commit 6677d34

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

src/index.tsx

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@ import "./globals.css";
3939

4040
await initParquetWasm();
4141

42-
const DEFAULT_INITIAL_VIEW_STATE = {
43-
latitude: 10,
44-
longitude: 0,
45-
zoom: 0.5,
46-
bearing: 0,
47-
pitch: 0,
48-
};
49-
5042
function App() {
5143
const actorRef = MachineContext.useActorRef();
5244
const isDrawingBBoxSelection = MachineContext.useSelector(
@@ -191,11 +183,7 @@ function App() {
191183
mapStyle: basemapState?.style || DEFAULT_MAP_STYLE,
192184
customAttribution,
193185
deckRef,
194-
initialViewState: ["longitude", "latitude", "zoom"].every((key) =>
195-
Object.keys(initialViewState).includes(key),
196-
)
197-
? initialViewState
198-
: DEFAULT_INITIAL_VIEW_STATE,
186+
initialViewState,
199187
layers: bboxSelectPolygonLayer
200188
? layers.concat(bboxSelectPolygonLayer)
201189
: layers,
@@ -211,14 +199,8 @@ function App() {
211199
// This condition is necessary to confirm that the viewState is
212200
// of type MapViewState.
213201
if ("latitude" in viewState) {
214-
const { longitude, latitude, zoom, pitch, bearing } = viewState;
215-
setViewState({
216-
longitude,
217-
latitude,
218-
zoom,
219-
pitch,
220-
bearing,
221-
});
202+
// TODO: ensure all view state types get updated on the JS side
203+
setViewState(viewState);
222204
}
223205
},
224206
parameters: parameters || {},

0 commit comments

Comments
 (0)