Skip to content

feat(MapView): add experimental symbolScaleBehavior - #4400

Merged
mfazekas merged 2 commits into
mainfrom
feat/symbol-scale-behavior
Oct 25, 2026
Merged

mfazekas merged 2 commits into
mainfrom
feat/symbol-scale-behavior

Conversation

@mfazekas

@mfazekas mfazekas commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Description

Added an experimental symbolScaleBehavior?: 'system' | { fixed: number } prop to MapView. It controls how map symbols (labels and icons) scale with the system text size.

It maps to iOS mapboxMap.symbolScaleBehavior = .system / .fixed(scaleFactor:) and Android mapboxMap.symbolScaleBehavior = SymbolScaleBehavior.system / SymbolScaleBehavior.fixed(x). Both are experimental and available since 11.19, so they work on the current default 11.23.1. The native default is fixed(1.0), and removing the prop resets to it. The iOS-only custom mapping closure (.system(mapping:)) isn't exposed. The JSDoc marks the prop @experimental.

There's a new Map/SymbolScaleBehavior example with buttons for 1x / 1.5x / 2x / system.

On web, { fixed } maps to mapbox-gl's experimental scaleFactor (3.8+). 'system' has no web equivalent, so web warns once and uses a scale of 1.

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 the new example on the iOS simulator (iPhone 17 Pro, iOS 26.5) and an Android emulator (Pixel 6), using SDK 11.23.1.

  1. { fixed: 1 } vs { fixed: 2 }: on both platforms, labels and icons render at about double size with 2.
  2. 'system': at the default text size it looks the same as 1x. I then raised the system text size: iOS content size accessibility-extra-extra-extra-large, Android font_scale 2.0. On both platforms the labels grew to about 2x, while { fixed: 1 } stayed at normal size. I restored the device settings afterwards.
4400-1x 4400-2x 4400-fixed-1 5-initial 4400-system

Map { fixed } to mapbox-gl's experimental scaleFactor. 'system' has no web
equivalent: it warns once and uses a scale of 1.
@mfazekas
mfazekas merged commit c18c382 into main Oct 25, 2026
10 checks passed
@mfazekas
mfazekas deleted the feat/symbol-scale-behavior branch October 25, 2026 21:00

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