You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Automatically adapt Mapbox Streets–sourced layers for Dynamic Type #7030
When a user adjusts the Dynamic Type or Accessibility Type setting in the Accessibility section of Settings, any style based on the Mapbox Streets source should automatically adjust by making the labels larger or smaller. We could make this behavior configurable for all layers, regardless of source, by having MGLStyleLayer conform to UIContentSizeCategoryAdjusting.
MGLMapView can observe UIContentSizeCategoryDidChangeNotification and respond by obtaining UIApplication.preferredContentSizeCategory, determining the identifiers of the sources whose URL matches mapbox://mapbox.mapbox-streets-v*, and adjusting the textSize of any MGLSymbolStyleLayer whose sourceIdentifier is one of those source identifiers.
Iterating over all the sources and style layers will require #6097. Discovering whether a source is Mapbox Streets will require #6584.
This is an alternative approach to #2429 that I think would be less aggressive.
#2429 (comment) points out that shield images would need to be scaled to fit their text. We’d have to work out how the iconTextFit property fits in with this proposal.
changed the title [-]Automatically adapt Mapbox Streets source layers for Dynamic Type[/-][+]Automatically adapt Mapbox Streets–sourced layers for Dynamic Type[/+]on Nov 11, 2016
#7031 would rely on a similar mechanism. I suspect localizing labels would be less cartographically disruptive than changing their size, but I think both should ultimately be the responsibility of the SDK.
That's true; accessibility text sizes aren't as specific to a particular source as languages are. The approach described here would require core changes, anyhow, because UIContentSizeCategoryAdjusting conformance needs to be implemented in a way that persists for the lifetime of an mbgl::style::Layer, not just an MGLStyleLayer that happens to wrap it.
Activity
1ec5 commentedon Nov 11, 2016
This is an alternative approach to #2429 that I think would be less aggressive.
#2429 (comment) points out that shield images would need to be scaled to fit their text. We’d have to work out how the
iconTextFitproperty fits in with this proposal.[-]Automatically adapt Mapbox Streets source layers for Dynamic Type[/-][+]Automatically adapt Mapbox Streets–sourced layers for Dynamic Type[/+]1ec5 commentedon Nov 11, 2016
#7031 would rely on a similar mechanism. I suspect localizing labels would be less cartographically disruptive than changing their size, but I think both should ultimately be the responsibility of the SDK.
kkaefer commentedon Nov 14, 2016
I don't think we should implement that kind of style manipulation at an SDK level. We need that feature on Android as well and should add it to core.
1ec5 commentedon Nov 14, 2016
That's true; accessibility text sizes aren't as specific to a particular source as languages are. The approach described here would require core changes, anyhow, because UIContentSizeCategoryAdjusting conformance needs to be implemented in a way that persists for the lifetime of an mbgl::style::Layer, not just an MGLStyleLayer that happens to wrap it.
felixLam commentedon Aug 18, 2017
For anyone interested we have open-sourced a "simple" approach to adjusting the fonts to match the user's preferred content size: https://github.com/iosphere/ISHMapboxDynamicFontObserver
hyerra commentedon Aug 2, 2018
Just double checking but is dynamic type functionality integrated into MapBox yet and if so how do we implement this on iOS?
stale commentedon Jan 29, 2019
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.
stale commentedon Feb 1, 2019
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.
friedbunny commentedon Feb 1, 2019
Still a thing that needs to be done, stalebot.
stale commentedon Jul 31, 2019
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.