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.

Refactor MGLMapSnapshotter attribution #10490

Closed

Description

@1ec5

As followup from #10456, MGLMapSnapshotter’s attribution logic is inflexible and needs to be refactored:

  • MGLSnapshotAttributionOptions goes away.
  • An MGLAttributionInfoStyle enumeration along the lines of NSFormattingUnitStyle or NSDateFormatterStyle. “Short” for a logo means just the helmet; “short” for an attribution item could mean abbreviation.
  • -[MGLMapSnapshotter logoImageWithStyle:] returns either the full image or the helmet image.
  • -[MGLAttributionInfo sizeWithStyle:] determines the size of an individual attribution image, depending on whether it’s abbreviated or written out in full.
  • -[MGLMapSnapshotter attributionSizeWithLogoStyle:sourceAttributionStyle:] takes two MGLAttributionInfoStyles and returns the size of the attribution.
  • The snapshot completion handler tries calling -[MGLMapSnapshotter attributionSizeWithLogoStyle:sourceAttributionStyle:] with each permutation of attribution info styles. Once one of the permutations fits the snapshot’s width, it uses -[MGLMapSnapshotter logoImageWithStyle:] and MGLAttributionInfo to put together the attribution.

/cc @fabian-guerra @lilykaiser

Activity

  1. added
    iOS
    macOS
    on Nov 17, 2017
  2. added this to the ios-v3.7.1 milestone on Nov 17, 2017
  3. fabian-guerra commented on Dec 4, 2017

    @fabian-guerra
    Contributor

    Fixed in #10525

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

iOSmacOSrefactor

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions