Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Automatically adapt Mapbox Streets–sourced layers for Dynamic Type #7030

Open
1ec5 opened this issue Nov 11, 2016 · 10 comments
Open

Automatically adapt Mapbox Streets–sourced layers for Dynamic Type #7030

1ec5 opened this issue Nov 11, 2016 · 10 comments
Labels
accessibility Integration with screen readers and other assistive technology feature gl-ios iOS Mapbox Maps SDK for iOS MapKit parity For feature parity with MapKit on iOS or macOS runtime styling

Comments

@1ec5
Copy link
Contributor

1ec5 commented Nov 11, 2016

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.

/ref tangrams/tangram-es#920
/cc @incanus @pveugen @boundsj @frederoni

@1ec5 1ec5 added feature iOS Mapbox Maps SDK for iOS runtime styling labels Nov 11, 2016
@1ec5
Copy link
Contributor Author

1ec5 commented 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 iconTextFit property fits in with this proposal.

@1ec5 1ec5 changed the title Automatically adapt Mapbox Streets source layers for Dynamic Type Automatically adapt Mapbox Streets–sourced layers for Dynamic Type Nov 11, 2016
@1ec5
Copy link
Contributor Author

1ec5 commented 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.

@1ec5 1ec5 added the MapKit parity For feature parity with MapKit on iOS or macOS label Nov 11, 2016
@kkaefer
Copy link
Contributor

kkaefer commented 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
Copy link
Contributor Author

1ec5 commented 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.

@1ec5 1ec5 added the accessibility Integration with screen readers and other assistive technology label Dec 7, 2016
@felixLam
Copy link

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
Copy link

hyerra commented 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 stale bot added the archived Archived because of inactivity label Jan 29, 2019
@stale
Copy link

stale bot commented 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 stale bot closed this as completed Jan 29, 2019
@friedbunny friedbunny reopened this Jan 30, 2019
@stale
Copy link

stale bot commented 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.

@stale stale bot closed this as completed Feb 1, 2019
@friedbunny
Copy link
Contributor

Still a thing that needs to be done, stalebot.

@friedbunny friedbunny reopened this Feb 1, 2019
@stale stale bot removed the archived Archived because of inactivity label Feb 1, 2019
@stale stale bot added the archived Archived because of inactivity label Jul 31, 2019
@stale
Copy link

stale bot commented 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.

@stale stale bot closed this as completed Jul 31, 2019
@friedbunny friedbunny reopened this Jul 31, 2019
@stale stale bot removed the archived Archived because of inactivity label Jul 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accessibility Integration with screen readers and other assistive technology feature gl-ios iOS Mapbox Maps SDK for iOS MapKit parity For feature parity with MapKit on iOS or macOS runtime styling
Projects
None yet
Development

No branches or pull requests

6 participants