Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
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

Open

Description

@1ec5

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

Activity

  1. added
    iOS
    on Nov 11, 2016
  2. 1ec5 commented on Nov 11, 2016

    @1ec5
    ContributorAuthor

    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.

  3. 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
  4. 1ec5 commented on Nov 11, 2016

    @1ec5
    ContributorAuthor

    #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.

  5. added
    MapKit parity
    on Nov 11, 2016
  6. kkaefer commented on Nov 14, 2016

    @kkaefer
    Member

    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.

  7. 1ec5 commented on Nov 14, 2016

    @1ec5
    ContributorAuthor

    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.

  8. added
    accessibility
    on Dec 7, 2016
  9. felixLam commented on Aug 18, 2017

    @felixLam

    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

  10. hyerra commented on Aug 2, 2018

    @hyerra

    Just double checking but is dynamic type functionality integrated into MapBox yet and if so how do we implement this on iOS?

  11. added
    archived
    on Jan 29, 2019
  12. stale commented on Jan 29, 2019

    @stale

    This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

  13. stale commented on Feb 1, 2019

    @stale

    This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

  14. friedbunny commented on Feb 1, 2019

    @friedbunny
    Contributor

    Still a thing that needs to be done, stalebot.

  15. removed
    archived
    on Feb 1, 2019
  16. added
    archived
    on Jul 31, 2019
  17. stale commented on Jul 31, 2019

    @stale

    This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

  18. removed
    archived
    on Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    MapKit parityaccessibilityfeaturegl-iosiOSruntime styling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions