Open 1ec5 opened 8 years ago
This is an alternative approach to #2429 that I think would be less aggressive.
https://github.com/mapbox/mapbox-gl-native/issues/2429#issuecomment-143821971 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.
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.
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.
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
Just double checking but is dynamic type functionality integrated into MapBox yet and if so how do we implement this on iOS?
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.
Still a thing that needs to be done, stalebot.
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.
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 obtainingUIApplication.preferredContentSizeCategory
, determining theidentifier
s of the sources whoseURL
matchesmapbox://mapbox.mapbox-streets-v*
, and adjusting thetextSize
of any MGLSymbolStyleLayer whosesourceIdentifier
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.
/ref tangrams/tangram-es#920 /cc @incanus @pveugen @boundsj @frederoni