Skip to content

feat(MapView): add experimental styleGlyphURL - #4398

Merged
mfazekas merged 2 commits into
mainfrom
feat/style-glyph-url
Oct 26, 2026
Merged

mfazekas merged 2 commits into
mainfrom
feat/style-glyph-url

Conversation

@mfazekas

@mfazekas mfazekas commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Description

Added an experimental styleGlyphURL prop to MapView. It overrides the style's glyph URL so labels can use fonts from another glyph server without editing the style.

It maps to iOS mapboxMap.styleGlyphURL (@_spi(Experimental), 11.8) and Android MapboxStyleManager.setStyleGlyphURL (@MapboxExperimental, 11.8), so it works on the current default 11.23.1. The value is re-applied on every style load, the same way localizeLabels is. Removing the prop restores the style's own glyphs from the next style load. The JSDoc marks the prop @experimental.

I didn't add an example: a glyph server with fonts matching the Mapbox styles' font stacks isn't something the example app can ship, and a broken URL that hides all labels isn't a useful demo.

On web it maps to mapbox-gl's Map#setGlyphsUrl (3.11+), applied on every style load.

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 the iOS simulator (iPhone 17 Pro, iOS 26.5) and an Android emulator (Pixel 6), using a temporary screen that isn't in this PR. It had a Street/Dark style toggle and styleGlyphURL toggling between https://glyphs.invalid/{fontstack}/{range}.pbf and unset. Both platforms behaved the same:

  1. With the broken URL, the Street style renders without any labels.
  2. Switching to Dark keeps the labels hidden, so the override is re-applied after the style load.
  3. Unsetting the prop and switching back to Street brings the labels back.
4398-after-style-switch-custom-host-blocked 4398-custom-glyphs-proxied

Apply it with mapbox-gl's Map#setGlyphsUrl on every style load.
@mfazekas
mfazekas force-pushed the feat/style-glyph-url branch from 3baec55 to 8ba36a3 Compare October 25, 2026 21:26
@mfazekas
mfazekas merged commit fe24ae5 into main Oct 26, 2026
10 checks passed
@mfazekas
mfazekas deleted the feat/style-glyph-url branch October 26, 2026 06:20

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