Skip to content

fix(web): ShowMapLocalStyle and GlobeProjection examples on web - #4386

Merged
mfazekas merged 1 commit into
mainfrom
web/fix-broken-examples
Oct 23, 2026
Merged

mfazekas merged 1 commit into
mainfrom
web/fix-broken-examples

Conversation

@mfazekas

Copy link
Copy Markdown
Contributor

Description

Three examples looked broken in the web example app:

  1. Map/ShowMapLocalStyle passes a style JSON string through styleURL, which native accepts. Web handed it to mapbox-gl as a URL, so it requested the JSON as a path and got a 404. Web MapView now parses styleURL as JSON when it starts with {. With that fixed, mapbox-gl still rejected the style because the asset has "glyphs": "" (and an empty sprite). Native ignores those. I removed them from the asset, and the style has no symbol layers, so nothing else changes.
  2. V10/GlobeProjection used mapbox://styles/mapbox-map-design/ckhqrf2tz0dt119ny6azh975y. The Styles API now answers "Style not found" for it, so it's blank on every platform. It now uses StyleURL.SatelliteStreet.
  3. Map/MapAndRNNavigation isn't broken. The map only appears after "Toggle map", and the modal buttons also show a map on web. No change.

Checklist

  • I've read CONTRIBUTING.md
  • I updated the doc/other generated code with running yarn generate in the root folder
  • I have tested the new feature on /example app.
    • In V11 mode/ios
    • In New Architecture mode/ios
    • In V11 mode/android
    • In New Architecture mode/android
  • I added/updated a sample - if a new feature was implemented (/example)

Screenshot OR Video

I tested on web only: an expo export -p web build served under /example-app/, plus expo start --web. Before the fix, ShowMapLocalStyle was blank with a 404 and GlobeProjection was blank with a 404 from the Styles API. After the fix, both render with no errors.

Component to reproduce the issue you're fixing

Open Map > Show Map Local Style and V10 > Globe Projection in the web example app.

Web MapView now parses a style JSON passed in styleURL, as native does.
The local style asset drops its empty sprite/glyphs entries, which
mapbox-gl rejects. GlobeProjection pointed at a style that no longer
exists; it now uses the satellite streets style.
@mfazekas
mfazekas merged commit 69242b7 into main Oct 23, 2026
10 checks passed
@mfazekas
mfazekas deleted the web/fix-broken-examples branch October 23, 2026 10:32

This branch was previously deployed

1 inactive deployment
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.

1 participant