Any downsides to having DeckGL as child of ReactMapGL?
See original GitHub issueHello,
I have two questions that I’d like your thoughts on.
- Is there any downside to mounting the
<DeckGL />
component as a child of theReactMapGL
component? In the documentation it shows the other way. This is my current setup and it’s working but I didn’t know if there were any downsides.<ReactMapGL touchAction="pan-y" onInteractionStateChange={this.updateInteractionState} attributionControl={false} controller={this._mapController} {...this.props.viewport} preventStyleDiffing reuseMaps width="100%" height="100%" onError={this._onReactMapGLError} getCursor={this.getCursor} interactiveLayerIds={this.props.interactiveLayerIds} mapStyle={this.props.mapStyleURI.length > 0 ? this.props.mapStyleURI : this.props.baseLayer} mapboxApiAccessToken={this.props.mapboxAccessToken} onLoad={this._onMapLoad} transformRequest={this._transformRequest} onViewportChange={this._onViewportChange} onClick={this._onClick} > <DeckGL viewState={this.props.viewport} getCursor={this._handleDeckGLCursor} {...this.props.deckProps} /> </ReactMapGL>
- Is it ok to mount multiple
<DeckGL>
components in the same project? Would this be ok?<> <DeckGL layers={...} /> <DeckGL layers={...} /> </>
Thank you in advance for any thoughts on this!
Issue Analytics
- State:
- Created 3 years ago
- Comments:13
Top Results From Across the Web
Using deck.gl with React
There are no performance advantages to this syntax but it can allow for a more consistent, React-like coding style.
Read more >React, Mapbox, Deck.GL Scatterplot Layer: Data Not Updating
I am trying to create a React app that uses deck.gl on a Mapbox map, and I am having trouble updating the "data"...
Read more >Popup - react-map-gl
A string indicating the part of the popup that should be positioned closest to the coordinate, set via longitude and latitude . If...
Read more >Using Mapbox GL JS with React - LogRocket Blog
npm install react-map-gl-geocoder deck.gl. Once we have this all set up, let's create a new SearchableMap map with the code below:
Read more >react map gl interactive layer ids rerender - You.com
deck.gl applications that render these components as children of DeckGL will stop working. I propose we move some of the current code to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Using
DeckGL
as a child ofReactMapGL
should work. In our docs we recommendStaticMap
as a child ofDeckGL
because:As @kylebarron said, if your two DeckGL instances renders to the same region, it is more performant to use multiple views. Otherwise, rendering two DeckGL instances is fine. If you have more than two, say 5-6, the hardware/browser may not support so many active WebGL contexts at once.
StaticMap
, which is more performant