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

Refactor MGLMapSnapshotter attribution #10490

Closed
1ec5 opened this issue Nov 17, 2017 · 1 comment
Closed

Refactor MGLMapSnapshotter attribution #10490

1ec5 opened this issue Nov 17, 2017 · 1 comment
Assignees
Labels
iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS refactor
Milestone

Comments

@1ec5
Copy link
Contributor

1ec5 commented Nov 17, 2017

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

@fabian-guerra
Copy link
Contributor

Fixed in #10525

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS refactor
Projects
None yet
Development

No branches or pull requests

2 participants