Visitar URL original
Add @deck.gl/maplibre for MapLibre GL JS v4/5/6 by birkskyum · Pull Request #10566 · visgl/deck.gl · GitHub
Skip to content

Add @deck.gl/maplibre for MapLibre GL JS v4/5/6 - #10566

Merged
chrisgervang merged 17 commits into
visgl:masterfrom
birkskyum:dedicated-maplibre6-package
Aug 20, 2026
Merged

chrisgervang merged 17 commits into
visgl:masterfrom
birkskyum:dedicated-maplibre6-package

Conversation

@birkskyum

@birkskyum birkskyum commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

This PR adds @deck.gl/maplibre and MapLibreOverlay for MapLibre GL JS v4.5.1, v5, and v6.

MapLibre v6 makes a dedicated integration timely. It is WebGL2-only and ESM-only, and its camera refactor removed the private map.transform object that MapboxOverlay depends on. MapLibre is also preparing for a broader graphics modernization, including an opt-in WebGPU renderer, which will increase its internal divergence from Mapbox GL JS. MapLibre's npm downloads are now on par with, and at times above, Mapbox GL JS.

A separate package makes it easier to use public APIs and TypeScript types directly, without adding more MapLibre-specific compatibility code to @deck.gl/mapbox. A small, isolated compatibility layer supports MapLibre v4.5.1 and v5 alongside the primary v6 path. Version 4.5.1 is the minimum because it is the first v4 release to expose the custom-layer render parameters required for public-API-only interleaved rendering.

MapLibreOverlay supports overlaid and WebGL2 interleaved rendering, including beforeId layer ordering. It addresses the core v6 compatibility failure described in #10501 and the raster rendering failure reported by GeoLibre.

Field of view synchronization (#10502), camera roll (#10503), and the existing GlobeView layer issues (#10519) remain separate work.

The MapLibre examples and documentation now use the new package. The React example uses react-map-gl v8.1, and the documentation includes the MapLibre v6 worker setup.

@deck.gl/mapbox is unchanged.

@greptile-apps

greptile-apps Bot commented Aug 16, 2026 •

Copy link
Copy Markdown

Greptile Summary

The PR introduces a dedicated MapLibre integration package supporting overlaid and interleaved rendering across MapLibre GL JS versions 4.5.1 through 6.

  • Adds MapLibreOverlay, compatibility helpers, layer-group synchronization, tests, and package exports.
  • Migrates MapLibre examples, documentation, the main bundle, and the Jupyter widget to the new package.
  • Updates MapLibre and React integration dependencies and worker configuration.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
modules/maplibre/src/overlay.ts Implements the MapLibre control lifecycle, overlaid and interleaved setup, event forwarding, and Deck property synchronization.
modules/maplibre/src/deck-utils.ts Implements shared-context Deck creation, camera synchronization, rendering callbacks, and interleaved lifecycle management.
modules/maplibre/src/resolve-layer-groups.ts Reconciles deck.gl layer ordering with MapLibre custom-layer groups.
modules/maplibre/package.json Defines the new ESM package, supported MapLibre peer range, and deck.gl/luma.gl peer dependencies.
test/modules/maplibre/overlay.spec.ts Adds coverage for overlay lifecycle, rendering modes, property updates, and MapLibre integration behavior.

Sequence Diagram

sequenceDiagram
  participant App
  participant MapLibreOverlay
  participant MapLibre
  participant Deck
  App->>MapLibre: Create map
  App->>MapLibreOverlay: Construct with layers and mode
  App->>MapLibre: addControl(overlay)
  MapLibre->>MapLibreOverlay: onAdd(map)
  alt Interleaved
    MapLibreOverlay->>Deck: Create with shared WebGL2 context
    MapLibreOverlay->>MapLibre: Add custom layer groups
    MapLibre->>MapLibreOverlay: Render layer groups
    MapLibreOverlay->>Deck: Draw matching deck.gl layers
  else Overlaid
    MapLibreOverlay->>Deck: Create separate canvas
    MapLibre->>MapLibreOverlay: Camera movement events
    MapLibreOverlay->>Deck: Synchronize view state
  end
Loading

Reviews (13): Last reviewed commit: "use maplibre 6 in examples" | Re-trigger Greptile

Comment thread modules/maplibre/package.json Resolved
Comment thread modules/maplibre/src/deck-utils.ts Resolved

@chrisgervang chrisgervang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @birkskyum! Left a review - overall supportive of the split, a long time coming. Agree that the modules are diverging. My main feedback is to revert dropping react-map-gl, and instead upgrade to 8.1 which ships support for v6.

The biggest risk with this change is making is clear which versions and modules to use - maplibre <6 still uses the mapbox module. If it's possible, I'd prefer we follow up with a compatibility layer for older maplibre versions in the maplibre module. Then, in the next major version of deck we can drop support for maplibre entirely from the mapbox module with the goal being to simplify and focus the modules, where possible.

Comment thread docs/get-started/getting-started.md Resolved
Comment thread examples/vite.config.local.mjs Resolved
Comment thread modules/maplibre/package.json Resolved
@birkskyum

birkskyum commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks @birkskyum! Left a review - overall supportive of the split, a long time coming. Agree that the modules are diverging. My main feedback is to revert dropping react-map-gl, and instead upgrade to 8.1 which ships support for v6.

Thanks! The React example is back on react-map-gl, upgraded to v8.1 with MapLibre v6 support.

The biggest risk with this change is making is clear which versions and modules to use - maplibre <6 still uses the mapbox module. If it's possible, I'd prefer we follow up with a compatibility layer for older maplibre versions in the maplibre module. Then, in the next major version of deck we can drop support for maplibre entirely from the mapbox module with the goal being to simplify and focus the modules, where possible.

I added a small isolated compatibility layer for MapLibre GL JS 4.5.1 and v5, while keeping v6 as the primary path. Version 4.5.1 is the minimum because it is the first v4 release to expose the custom-layer render parameters needed for doing interleaved rendering only relying on maplibre's public API.

So, @deck.gl/maplibre now supports 4.5.1, v5, and v6, and we can guide supported MapLibre users to this package in deck.gl 9 and remove MapLibre compatibility from @deck.gl/mapbox in the next major version.

@birkskyum birkskyum changed the title Add @deck.gl/maplibre for MapLibre GL JS v6+ Add @deck.gl/maplibre for MapLibre GL JS v4-6 Aug 17, 2026
Comment thread docs/api-reference/maplibre/overview.md Resolved
Comment thread modules/maplibre/package.json Resolved
Comment thread modules/maplibre/src/deck-utils.ts Resolved
Comment thread vitest.config.ts Resolved
Comment thread vitest.config.ts Resolved

@chrisgervang chrisgervang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm! I'd like a second opinion from @Pessimistress since this is change is proposing a new module.

@coveralls

coveralls commented Aug 17, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 82.18% (-0.3%) from 82.497% — birkskyum:dedicated-maplibre6-package into visgl:master

@birkskyum birkskyum changed the title Add @deck.gl/maplibre for MapLibre GL JS v4-6 Add @deck.gl/maplibre for MapLibre GL JS v4/5/6 Aug 17, 2026
@chrisgervang chrisgervang added this to the v9.4 milestone Aug 19, 2026
@chrisgervang

Copy link
Copy Markdown
Collaborator

fyi #10551 may need to be applied to this module

@birkskyum

birkskyum commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor Author

fyi #10551 may need to be applied to this module

@chrisgervang We shoudl be good already. This case is covered in the getMapLibreProjection() in compatibility.ts

@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown

Want your agent to iterate on Greptile's feedback? Try greploops.

@chrisgervang

Copy link
Copy Markdown
Collaborator

Is this good to go @birkskyum?

@birkskyum

Copy link
Copy Markdown
Contributor Author

@chrisgervang yes, it's ready now.

@chrisgervang
chrisgervang merged commit c32a71b into visgl:master Aug 20, 2026
7 checks passed
@birkskyum

Copy link
Copy Markdown
Contributor Author

Thanks for processing this! I think it's a big step forward to now be fully on public api, and relying on the maplibre type definitions. Would it be possible to cut a 9.4.0-alpha.3 release to get @deck.gl/maplibre on npm?

@chrisgervang

Copy link
Copy Markdown
Collaborator

Yes, we'll be cutting one soon

@tangs8dj

Copy link
Copy Markdown

@chrisgervang
Hello, I don't seem to see the 9.4.0+alpha.3 version.

@birkskyum

birkskyum commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor Author

@tangs8dj , it's released in @deck.gl/maplibre and deck.gl v9.4.0-beta.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants