Side-by-side with Mapbox as base map #9010
-
Hi, I have a question - how can I get a side-by-side view with two deck.gl MapViews, each with a Mapbox base map, both in reverse controlled mode and with synced viewState? Is this even possible? I have been searching the documentation for a working example, but I have yet to find one. I would imagine something like this: import { Map } from "react-map-gl"
...
const deckglRef = useRef<DeckGLRef>(null)
const { initialViewState } = useMapViewState()
return (
<DeckGL
initialViewState={initialViewState}
ref={deckglRef}
style={{ width: "100%", height: "100%" }}
>
<MapView id="left" controller={true} x={0} width="50%">
<Map
id="left"
reuseMaps
mapStyle={mapBaseStyle}
mapboxAccessToken={PUBLIC_MAPBOX_ACCESS_TOKEN}
/>
</MapView>
<MapView id="right" controller={true} x="50%" width="50%">
<Map
id="right"
reuseMaps
mapStyle={mapBaseStyle}
mapboxAccessToken={PUBLIC_MAPBOX_ACCESS_TOKEN}
/>
</MapView>
</DeckGL> But I'm getting the following TS error:
Thank you! |
Beta Was this translation helpful? Give feedback.
Answered by
Pessimistress
Jul 8, 2024
Replies: 1 comment 1 reply
-
Unfortunately the JSX pattern does not work with TypeScript. You need to add a |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
vojtatom
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unfortunately the JSX pattern does not work with TypeScript. You need to add a
@ts-ignore
to work around the error.