Skip to content

docs: update the MapLibre GL JS examples to 6.16 - #3671

Merged
blacha merged 3 commits into
linz:masterfrom
birkskyum:maplibre-6-examples
Oct 28, 2026
Merged

blacha merged 3 commits into
linz:masterfrom
birkskyum:maplibre-6-examples

Conversation

@birkskyum

@birkskyum birkskyum commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

The MapLibre examples load versions from 1.14.0-rc.1 to 4.5.0, and the swipe example also loads Mapbox GL JS 2.3 only to get the compare plugin.

Modifications

Loads MapLibre GL JS 6.16 in the eight docs and landing examples. 6.x ships as ES modules only, so the scripts become module scripts that import it, and the integrity attributes go since a module import can't carry one. The swipe example uses @maplibre/maplibre-gl-compare instead of Mapbox GL JS and mapbox-gl-compare.

The swipe example on 6.16 with @maplibre/maplibre-gl-compare

linz-upgrade-swipe

Verification

Opened all eight in Chrome, the landing ones on basemaps.linz.govt.nz with an API key in localStorage. They load with no console errors or failed requests, the two maps in the opacity and swipe examples stay in sync, the slider and the swiper work, and terrain loads in the elevation example. The docs build gives the same warnings as on master.

@birkskyum
birkskyum requested a review from a team as a code owner October 28, 2026 00:37
@blacha

blacha commented Oct 28, 2026

Copy link
Copy Markdown
Member

Hi @birkskyum Thanks heaps for taking the time to look at this!

Is there anychance you could add the integrity checksum back in.

A quick AI fix suggested this method, which works in chrome/firefox

    <script type="importmap">
      {
        "imports": {
          "maplibre-gl": "https://unpkg.com/maplibre-gl@6.16.0/dist/maplibre-gl.mjs"
        },
        "integrity": {
          "https://unpkg.com/maplibre-gl@6.16.0/dist/maplibre-gl.mjs": "sha384-uLwQnFL74rrONqIWx/ubL4wcAtA2h08tbMDZd9U4KbQ7GhaA7S1XKepHU89UkU7C"
        }
      }
    </script>
    <script type="module">
      import * as maplibregl from 'maplibre-gl';
      // ...
    </script>

@birkskyum

Copy link
Copy Markdown
Contributor Author

@blacha I have added the integrity check

@blacha blacha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A couple more locations missing the integrity checks

@blacha
blacha added this pull request to the merge queue Oct 28, 2026
Merged via the queue into linz:master with commit 5659fae Oct 28, 2026
13 checks passed
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.

2 participants