Map renderer integrations
Map renderer integrations place deck.gl layers inside an existing map system while keeping the layers aligned with the host camera and render cycle. The Mapbox, MapLibre, Google Maps, and ArcGIS packages let the host map own its canvas and input model while deck.gl supplies the visualization layers.
Integration modes
The integrations use two main ownership models. In a host-controlled model, the map remains the root system and deck.gl follows its camera. In a deck-controlled model, Deck is the root and the map becomes a visual child.
| Mode | Camera owner | Canvas and render owner | Main result |
|---|---|---|---|
| Overlaid | Host map | Separate deck.gl canvas | Deck layers appear above the map. Host controls and plugins remain available. |
| Interleaved | Host map | Host map canvas and render cycle | Deck layers can occupy positions in the host layer stack and share depth with map content. |
| Reverse-controlled | deck.gl | deck.gl | Deck manages the view and input. The map is shown as a child or background and does not receive normal interaction. |
The first two modes use an overlay object that the host map adds through its own extension point. Reverse-controlled mode is normally provided by the core React or standalone Deck integration rather than by these map overlay classes. See Application integrations for the wider integration map, React integration for component ownership, Widgets and Jupyter for map-independent UI controls, and Python bindings for non-JavaScript entry points.
The shared flow keeps host state as the source of truth and turns each host render into a deck.gl render with the same view geometry.
flowchart LR
A[Host map camera] --> B[Camera and viewport sync]
B --> C[Deck layer render]
C --> D{Rendering mode}
D --> E[Separate deck canvas]
D --> F[Host canvas and layer stack]
G[Host map events] --> H[Deck picking and callbacks]
H --> C
Host-controlled overlays
Mapbox, MapLibre, and Google Maps expose overlay classes that accept deck.gl properties and update the underlying Deck instance when those properties change. The host map disables deck.gl's normal camera controller, sends camera changes into deck.gl, and schedules a redraw when the host view changes. The overlay also keeps host input as the interaction source, then forwards the relevant events to deck.gl for picking and layer callbacks.
Overlaid mode gives Deck its own canvas. Interleaved mode gives Deck the host WebGL context and drawing buffer, so host-owned canvas size and device-pixel state take precedence over Deck's independent canvas settings. The shared Deck instance follows the host view and does not resize the shared canvas itself. Both modes release their listeners, layer registrations, and Deck resources through the host removal lifecycle.
References: modules/…/mapbox-overlay.ts• L22-87 modules/…/mapbox-overlay.ts• L98-139 modules/…/deck-utils.ts• L27-84 modules/…/overlay.ts• L27-95 modules/…/overlay.ts• L172-216 modules/…/deck-utils.ts• L114-169 modules/…/google-maps-overlay.ts• L36-110
Deck-controlled map compositions
Reverse-controlled compositions make deck.gl the outer view and use the map as a child. This model is useful for custom input handling, multiple views, or layouts where the map does not fill the full deck.gl canvas. It gives up the host map's normal controls and plugins because deck.gl owns the interaction surface.
References: docs/…/using-with-mapbox.md• L29-34 docs/…/using-with-maplibre.md• L29-34 docs/…/using-with-google-maps.md• L26-30
Shared camera and render synchronization
Camera synchronization converts each host camera into the deck.gl view state needed to project geographic positions. Render synchronization then uses the host's redraw signal or render callback so that deck.gl does not create a competing map frame.
Camera state
The Mapbox-compatible integrations read the map center, zoom, bearing, pitch, padding, and world-copy state. They also select a map view or globe view from the host projection. MapLibre can include the host camera elevation in the view state, which keeps the deck view aligned with elevated map cameras. During the globe transition, the integration blends the host elevation so the deck camera follows the same change in target. When terrain changes that elevation without a move event, the render callback refreshes the deck view state so picking remains aligned.
MapLibre interleaved rendering also uses the host near and far depth values. The adapter accepts the current MapLibre render parameters and rejects versions that do not provide them, because deck.gl must use the same depth range as the host map.
Google Maps uses a different camera interface. Its vector path supplies camera data through a coordinate transformer, while its raster path derives the view from the overlay projection. Both paths update the deck canvas position and view state so geographic objects stay over the same map locations.
ArcGIS follows the same goal through its MapView or SceneView camera. Its adapters translate the active map center, scale, rotation, heading, tilt, and resolution into a deck.gl view for each render pass. The 3D renderer also anchors the view to the current screen focal point, derives zoom from the local ground distance per pixel, and estimates altitude from the live camera distance. At high tilt, it blends that distance with a fixed field-of-view estimate to reduce camera drift.
References: modules/…/deck-utils.ts• L165-230 modules/…/deck-utils.ts• L76-111 modules/…/deck-utils.ts• L240-267 modules/…/deck-utils.ts• L312-323 modules/…/compatibility.ts• L18-84 modules/…/utils.ts• L129-225 modules/…/utils.ts• L227-269 modules/…/deck-layer-view-2d.ts• L50-68 modules/…/deck-renderer.ts• L21-95 modules/…/deck-renderer.ts• L172-223
Render lifecycle
In overlaid mode, the adapter sizes a separate canvas to the map container and redraws it after host render or overlay callbacks. In interleaved mode, the host owns the WebGL context, canvas size, device-pixel state, and drawing buffer. Deck.gl renders without clearing the host canvas, then asks the host to repaint when its own state changes.
Mapbox and MapLibre reuse one shared Deck instance for an interleaved map context. Map movement updates the deck view and marks it for redraw. Each host render uses the current viewport for each deck layer group, draws into the existing map frame, and requests another host repaint when deck.gl has new work. MapLibre also checks for terrain elevation changes because terrain can change the camera state without a move event. MapLibre style and source loading can defer layer-group changes until the host style is ready.
Google Maps selects the lifecycle at run time. Vector maps use WebGL overlay callbacks when interleaving is possible. Raster maps use the standard overlay draw callback. A vector map can still use a separate deck canvas when interleaving is disabled. If the map has not selected its rendering type when the overlay is attached, setup waits for that state before choosing the vector or raster path. If Google Maps changes that type later, the adapter removes the old path and creates the matching one so a Deck instance does not keep using an incompatible host context. In the shared path, deck.gl draws into the framebuffer selected by Google Maps and preserves the host render state.
ArcGIS owns the render graph. The 2D layer view renders deck.gl content into an auxiliary target and composites it into the ArcGIS frame. The 3D renderer registers as a RenderNode, binds the current ArcGIS render target, and requests a new host frame when deck.gl needs one. It initializes deck resources when the host WebGL context becomes available and releases them when the render node is disposed.
References: modules/…/mapbox-overlay.ts• L98-163 modules/…/deck-utils.ts• L27-84 modules/…/deck-utils.ts• L123-163 modules/…/deck-utils.ts• L323-373 modules/…/overlay.ts• L220-299 modules/…/overlay.ts• L265-299 modules/…/deck-utils.ts• L35-73 modules/…/deck-utils.ts• L114-186 modules/…/deck-utils.ts• L189-223 modules/…/deck-utils.ts• L270-323 modules/…/google-maps-overlay.ts• L69-95 modules/…/google-maps-overlay.ts• L138-187 modules/…/google-maps-overlay.ts• L301-433 modules/…/commons.ts• L52-151 modules/…/deck-renderer.ts• L98-167 modules/…/deck-renderer.ts• L245-266
Mapbox and MapLibre integrations
The Mapbox and MapLibre packages serve the same broad role for Mapbox GL JS-compatible maps. Their overlay controls follow the host camera and can either draw over the map or add deck.gl render groups to the host style layer order.
Mapbox overlay
The @deck.gl/mapbox package exposes MapboxOverlay through modules/…/mapbox-overlay.ts. It supports a separate canvas by default and an interleaved mode that uses the map's WebGL2 context. Mapbox remains responsible for camera movement, map controls, and the render schedule.
In interleaved mode, deck.gl layers are grouped by their beforeId or Mapbox Standard Style slot. Each group becomes one custom map layer. The group gives Mapbox a stable insertion point while deck.gl keeps the layers in their application order inside that group. Because Mapbox owns the shared drawing buffer, canvas size, and device-pixel state in this mode, the shared Deck instance does not apply its separate canvas settings. It follows Mapbox view changes and asks Mapbox to repaint when deck state changes.
References: modules/…/mapbox-overlay.ts• L35-43 modules/…/mapbox-overlay.ts• L58-67 modules/…/mapbox-overlay.ts• L142-163 modules/…/mapbox-overlay.ts• L175-213 modules/…/deck-utils.ts• L27-84 modules/…/deck-utils.ts• L123-163 modules/…/resolve-layer-groups.ts• L22-91 modules/…/mapbox-layer-group.ts• L11-49 modules/…/package.json• L44-51
MapLibre overlay
The @deck.gl/maplibre package exposes MapLibreOverlay through modules/…/overlay.ts. It uses MapLibre's public control and custom-layer interfaces, supports overlaid and interleaved rendering, and can follow Mercator or the experimental globe projection. Its peer contract supports MapLibre GL JS 4.5.1, 5, and 6.
Interleaved rendering requires WebGL2 and supports one interleaved deck.gl overlay per map. A beforeId places a deck.gl group before a MapLibre style layer. MapLibre style changes cause the integration to restore the deck groups and refresh the selected projection. If the style or its sources are still loading, group updates wait until the style can accept them. The overlay also keeps the deck view tied to MapLibre movement and terrain elevation changes, then uses the host render pass for shared-canvas drawing.
The overlay accepts independent canvas and device settings for overlaid rendering. Interleaved rendering keeps those resources under MapLibre's control. If setup fails while the control is being added, the overlay removes the partial Deck or layer state before it reports the error.
References: modules/…/package.json• L39-51 modules/…/overlay.ts• L41-48 modules/…/overlay.ts• L57-114 modules/…/overlay.ts• L218-299 modules/…/overlay.ts• L324-335 modules/…/deck-utils.ts• L35-57 modules/…/deck-utils.ts• L76-111 modules/…/deck-utils.ts• L114-186 modules/…/deck-utils.ts• L225-323 modules/…/compatibility.ts• L23-84 modules/…/resolve-layer-groups.ts• L17-83
Layer-stack placement
Interleaving is the option to use when deck.gl content must pass behind labels, appear between map layers, or share depth with 3D map objects. Overlaid rendering is the better fit when the application needs host controls or plugins but does not need deck.gl content inside the map's layer stack.
The group key is part of the rendering contract. Layers that need a shared rendering context for an extension must use the same insertion key. A missing or changing host style layer can also prevent the requested insertion point from being used.
References: docs/…/using-with-mapbox.md• L11-33 docs/…/using-with-maplibre.md• L11-33 docs/…/mapbox-overlay.md• L118-124 docs/…/overview.md• L61-70
Google Maps integration
The @deck.gl/google-maps package exposes GoogleMapsOverlay through modules/…/google-maps-overlay.ts. It adapts to the Google Maps rendering type at run time so the same deck.gl layer set can work with vector and raster maps.
Vector and raster rendering
Vector maps can use WebGLOverlayView. In interleaved mode this gives deck.gl the Google-owned WebGL2 context and places deck.gl drawing in the Google render flow. In non-interleaved vector mode, a standard overlay positions the deck canvas while the WebGL overlay supplies smooth camera updates.
Raster maps use OverlayView and a separate deck.gl canvas. This mode supports the basic geographic overlay path, but it does not provide the full vector 3D behavior for tilt, rotation, and fractional zoom. If the map is not ready when the overlay is attached, the integration waits for the rendering type before creating the matching overlay path. It also rebuilds the overlay when Google Maps changes between rendering types, because the vector and raster paths do not share the same rendering context or lifecycle.
References: modules/…/google-maps-overlay.ts• L69-95 modules/…/google-maps-overlay.ts• L138-187 modules/…/google-maps-overlay.ts• L190-234 modules/…/google-maps-overlay.ts• L44-52 docs/…/using-with-google-maps.md• L9-30
Camera and canvas placement
The Google adapter keeps the deck canvas in the map's overlay surface and updates its size and position as the map moves. It reads raster camera data from the map projection and vector camera data from the coordinate transformer. It uses the host map's CSS size as the view size and applies the configured device-pixel preference so deck rendering matches the host surface. In interleaved mode, Google Maps owns the drawing buffer, so deck.gl uses the host dimensions and draws into the current host render target without clearing the map.
The map also remains the input owner. Google map events are converted into deck.gl picking events so onClick, onHover, and related layer callbacks can still identify deck.gl objects without enabling deck.gl's controller. The adapter removes those event listeners when the Deck instance is replaced or finalized, and it hides layers during host removal so a detached overlay does not keep drawing.
References: modules/…/utils.ts• L25-92 modules/…/utils.ts• L107-125 modules/…/utils.ts• L129-269 modules/…/utils.ts• L295-348 modules/…/google-maps-overlay.ts• L301-433
ArcGIS integration
The @deck.gl/arcgis package connects deck.gl to ArcGIS API for JavaScript layer and render-node lifecycles. It has separate integration forms for 2D MapView and 3D SceneView because ArcGIS supplies different camera and rendering contracts for each view.
2D map layers
DeckLayer is an ArcGIS map layer for MapView. ArcGIS creates its layer view and controls when that view attaches, renders, redraws, and detaches. The layer exposes deck.gl properties through the ArcGIS property system, so application updates flow into the deck.gl instance without changing who owns the map camera or input events.
The 2D layer view uses ArcGIS's WebGL context and composites deck.gl output into the ArcGIS frame. Each render reads the current ArcGIS view size and map state, then supplies the matching geographic view to deck.gl.
References: modules/…/deck-layer.ts• L5-35 modules/…/deck-layer-view-2d.ts• L7-69 modules/…/deck-props.ts• L5-60 modules/…/package.json• L42-49 docs/…/deck-layer.md• L1-5
3D scene renderers
DeckRenderer is an experimental ArcGIS RenderNode integration for a local SceneView. It is attached to the scene render graph rather than added as a map layer. ArcGIS supplies the live camera and render target, while the renderer converts the scene camera into a deck.gl view and draws during the ArcGIS frame.
For each frame, the renderer anchors the deck view to the scene's screen focal point. It uses the local ground distance per pixel to keep zoom stable under tilt, then estimates altitude from the distance between the camera and focal point. At high tilt, it blends this value with a fixed field-of-view estimate to reduce the remaining mismatch between ArcGIS's camera model and deck.gl's view model. It requests another scene render when deck.gl state changes and releases its GPU resources when the render node is disposed.
References: modules/…/deck-renderer.ts• L21-95 modules/…/deck-renderer.ts• L98-167 modules/…/deck-renderer.ts• L172-223 modules/…/deck-renderer.ts• L245-266 modules/…/package.json• L42-49 docs/…/deck-renderer.md• L1-5 docs/…/using-with-arcgis.md• L7-13
ArcGIS property bridge
ArcGIS applications update deck.gl layers through the deck property on DeckLayer or DeckRenderer. The bridge watches the supported properties and forwards changed values to the live Deck instance. This keeps ArcGIS's observable object model as the update boundary while deck.gl remains the renderer for the visualization content.
References: modules/…/deck-props.ts• L26-61 modules/…/deck-layer.ts• L9-24 modules/…/package.json• L42-49 docs/…/deck-layer.md• L68-83 docs/…/deck-renderer.md• L70-86
Integration boundaries
These packages solve map camera, canvas, render timing, and event handoff. They do not replace the host map's tile service, style system, authentication, or UI controls. Applications choose the host map package and its React companion when they need a declarative component tree.
React ownership
For Mapbox and MapLibre, a React map component commonly owns the map and MapboxOverlay or MapLibreOverlay is attached through a control hook. For Google Maps, the overlay is attached to the map returned by the Google React provider. In reverse-controlled layouts, DeckGL owns the tree and the map is a child.
References: docs/…/using-with-mapbox.md• L226-235 docs/…/using-with-maplibre.md• L227-235 docs/…/using-with-google-maps.md• L170-178
Change checklist
When these files or sections are changed, remember to consider these:
- A change to host camera fields or projection support must stay aligned with the corresponding deck.gl view and viewport conversion in all relevant renderer adapters.
- A change to MapLibre elevation, globe-transition rules, padding, or near and far depth data must preserve the geographic view used by both overlaid and interleaved rendering.
- A change to
beforeId,slot, or style-layer grouping must preserve both insertion order and the shared-context needs of layer extensions. - A change to shared-context rendering must preserve host framebuffer state, canvas ownership, redraw requests, and depth or blend behavior.
- A change to host lifecycle callbacks must cover attach, style or rendering-type changes, context loss, removal, partial setup failure, and final resource cleanup.
- A change to interleaved pixel or device settings must preserve the host map's ownership of the shared drawing buffer and the separate-canvas settings for overlaid mode.
- A change to ArcGIS deck properties must be reflected in the Accessor bridge and in both the 2D layer-view and 3D RenderNode paths when the property is supported by both.
- A change to ArcGIS 3D camera conversion must keep the focal-point anchor, local ground scale, altitude estimate, and high-tilt blend aligned with the SceneView render target.
- A change to map input translation must preserve the event coordinates used by deck.gl picking and must not re-enable a second camera controller.
- A change to a package peer dependency must preserve the host renderer versions and rendering contracts described for that integration. MapLibre supports GL JS 4.5.1, 5, and 6. The other adapters require their matching host APIs and deck.gl core contract.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| Interleaved Mapbox or MapLibre rendering runs without a usable WebGL2 context. | The overlay cannot share the host render path and may fail during setup. | Use overlaid rendering or a host map configuration with WebGL2 support. |
| MapLibre reports a projection other than Mercator or globe. | View creation fails because deck.gl cannot select a matching map view. | Use a supported MapLibre projection before attaching the interleaved overlay. |
| Interleaved MapLibre rendering receives no usable near and far depth values from the host render callback. | The integration cannot use the required render parameters and may reject the host MapLibre version. | Use MapLibre GL JS 4.5.1 or later with the supported render parameters. |
| MapLibre terrain changes the center elevation without a host move event and the render sync is bypassed. | Deck.gl picking uses stale view state and can identify the wrong geographic position. | Keep the render-time elevation check active before picking or drawing. |
| A MapLibre style already owns the generated deck layer-group id. | The integration rejects the group instead of replacing an unrelated style layer. | Keep application style-layer ids separate from deck-generated group ids. |
A requested beforeId or slot is absent from the current style. | The deck group cannot reach the intended position in the host layer stack. | Resolve insertion targets after the style is loaded and after style changes. |
| Google Maps uses a raster map or a vector map without the required WebGL path. | Interleaved 3D behavior is unavailable and the overlay uses a separate canvas. | Select a vector map for interleaving and design for the raster fallback. |
| Google Maps has not selected a rendering type when the overlay is attached and setup does not wait for it. | The adapter can select the wrong overlay lifecycle or fail before the map is ready. | Attach the matching overlay only after the map reports its rendering type. |
| Google Maps changes rendering type and the old Deck instance or host context is reused. | The overlay can draw with stale camera, canvas, or WebGL state. | Recreate the matching overlay path and Deck instance after a rendering-type change. |
| An overlay attach fails after partial Deck or layer setup and the partial cleanup path is bypassed. | Listeners, generated style layers, or GPU resources can remain attached to the map. | Let the overlay complete its failure cleanup before handling the attach error. |
An ArcGIS SceneView is used with the 2D DeckLayer. | No 3D layer view is created for the deck layer. | Use DeckRenderer with a local SceneView for the experimental 3D path. |
| The ArcGIS 3D focal point or one-pixel ground sample is unavailable. | The renderer falls back to the scene center or scale and camera alignment can be less exact. | Keep the SceneView ready for focal-point sampling and use a valid render target size. |
| An overlay or render node is removed without its host cleanup path. | Event listeners, GPU resources, or shared deck state can remain attached to the map. | Use the integration's removal or finalization lifecycle rather than discarding the object. |
Key files
| File | Why to read it |
|---|---|
| modules/…/mapbox-overlay.ts | Main Mapbox control. Shows camera updates, canvas ownership, host events, mode selection, and cleanup. |
| modules/…/deck-utils.ts | Shared Mapbox-compatible camera conversion, shared Deck state, host-owned shared-canvas settings, and interleaved render coordination. |
| modules/…/resolve-layer-groups.ts | Defines how deck.gl layers enter and move within the host style stack. |
| modules/…/overlay.ts | Main MapLibre control and its overlaid, interleaved, style-loading, setup-failure, and cleanup paths. |
| modules/…/deck-utils.ts | MapLibre shared-deck state, camera and projection sync, terrain elevation refresh, host repaint flow, and custom-layer drawing. |
| modules/…/compatibility.ts | Defines the MapLibre projection, elevation, supported-version, and render-parameter compatibility boundary. |
| modules/…/google-maps-overlay.ts | Chooses vector or raster overlay lifecycles, handles rendering-type changes, and drives each Google render path. |
| modules/…/utils.ts | Converts Google projection and coordinate-transformer data into deck view state and input coordinates. It also owns Deck creation and map-event cleanup. |
| modules/…/deck-layer-view-2d.ts | Connects a deck layer to the ArcGIS 2D attach, render, redraw, and detach lifecycle. |
| modules/…/deck-renderer.ts | Connects deck.gl to the ArcGIS 3D RenderNode, SceneView camera, focal-point scale, and altitude matching. |
| modules/…/commons.ts | Defines the shared deck resource and composition path used by ArcGIS renderers. |
| modules/…/package.json | Defines the Mapbox package contract with deck.gl core, luma.gl, and math.gl dependencies. |
| modules/…/package.json | Defines the supported MapLibre GL JS host versions and the package contract. |
| modules/…/package.json | Defines the Google Maps type package and the deck.gl and luma.gl rendering contract. |
| modules/…/package.json | Defines the ArcGIS API peer contract and the deck.gl and luma.gl rendering dependencies. |