chore: upgrade website and examples to MapLibre v6 - #2602
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 30088af. Configure here.
Pessimistress
approved these changes
Jul 29, 2026
Contributor
Author
|
Added |
chrisgervang
commented
Jul 29, 2026
Comment on lines
509
to
+511
| #### `workerUrl`: string {#workerurl} | ||
|
|
||
| Provides an interface for loading maplibre-gl's WebWorker bundle from a self-hosted URL. This is useful if your site needs to operate in a strict CSP (Content Security Policy) environment wherein you are not allowed to load JavaScript code from a Blob URL, which is default behavior. | ||
|
|
||
| Provides an interface for loading maplibre-gl's WebWorker bundle from a self-hosted URL. MapLibre GL JS v6 applications that use a bundler must configure the worker before rendering a map. Follow MapLibre's [installation instructions](https://maplibre.org/maplibre-gl-js/docs/#installation) to generate the appropriate worker URL for your bundler. |
Contributor
Author
There was a problem hiding this comment.
I wonder if examples can use this instead of setWorkerUrl
| import {useRef, useEffect} from 'react'; | ||
| import {Map, Popup} from 'react-map-gl/maplibre'; | ||
| import maplibregl from 'maplibre-gl'; | ||
| import * as maplibregl from 'maplibre-gl'; |
Contributor
Author
There was a problem hiding this comment.
Type only import?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Follow-up to #2598.
Summary
maplibre-gl@^6.0.0maplibre-gl-worker.mjs?worker&urland callsetWorkerUrlbefore renderingThis changes website and example setup only. It does not change react-map-gl's public API or core runtime behavior.
Testing
yarn lintyarn testmaplibre-gl-shared.mjsimportyarn --cwd website build/react-map-gl/Note
Low Risk
Documentation, example, and website dependency upgrades only; react-map-gl library code is untouched.
Overview
Upgrades the docs site and all MapLibre examples from maplibre-gl v5 to ^6.0.0, with setup changes required by MapLibre v6 (ESM-only package and mandatory worker configuration for bundler apps).
Documentation now distinguishes v4/v5 default imports from v6 namespace/named imports (
import * as maplibregl), documents that v6 apps must configure the worker before rendering, and notes v8.1 supports MapLibre v4–v6. API reference snippets formapLib, refs, and imperative examples useimport * as maplibregl.Vite MapLibre examples call
setWorkerUrlwithmaplibre-gl-worker.mjs?worker&url, load CSS via module import instead of unpkg links, and bump dependencies to^6.0.0.Docusaurus website copies worker and shared
.mjsassets, registers a client module that sets the worker URL under the site base path, aliasesmaplibre-glto the ESM entry for SSR, and refreshes vendored MapLibre CSS and lockfile.No changes to react-map-gl’s public API or core map wrapper runtime.
Reviewed by Cursor Bugbot for commit bdef0d5. Bugbot is set up for automated code reviews on this repo. Configure here.