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

Source-driven attribution #5999

Merged
merged 8 commits into from
Dec 9, 2016
Merged

Commits on Dec 8, 2016

  1. [ios, macos] Source-driven attribution

    Refactored MGLSource initialization. Implemented a new private class, MGLAttributionInfo, that parses an HTML attribution string from TileJSON and stores the resulting structured data. Added methods to MGLTileSet and MGLStyle to aggregate MGLAttributionInfos.
    
    On macOS, update the attribution view as soon as the source attribution changes. On iOS, fetch the current attribution information when displaying the action sheet.
    
    Removed hard-coded attribution strings.
    1ec5 committed Dec 8, 2016
    Configuration menu
    Copy the full SHA
    2585ba7 View commit details
    Browse the repository at this point in the history
  2. [macos] Respect inline formatting in attribution HTML

    Apply a default font and color to attribution HTML as it is imported into an attributed string. Pass the attributed string into MGLAttributionButton as is, without stripping formatting. Avoid overriding the font and color after importing the HTML, in case these attributes are explicitly specified rather than intrinsic to a hyperlink.
    
    Constrain the top of the attribution view to all the attribution buttons, in case one of them needs additional headspace.
    1ec5 committed Dec 8, 2016
    Configuration menu
    Copy the full SHA
    8815588 View commit details
    Browse the repository at this point in the history
  3. [ios, macos] Display unlinked attribution strings

    Unlinked attribution strings are represented on macOS as buttons that have the default cursor and do nothing when clicked. On iOS, they are action sheet buttons that do nothing but dismiss the action sheet.
    1ec5 committed Dec 8, 2016
    Configuration menu
    Copy the full SHA
    567692b View commit details
    Browse the repository at this point in the history
  4. [macos] Fixed random Auto Layout exception

    Auto Layout randomly finds itself unable to satisfy constraints when updating attribution, due to some spurious constraints between attribution buttons. Regenerate the entire attribution view every time the source attribution changes.
    1ec5 committed Dec 8, 2016
    Configuration menu
    Copy the full SHA
    8e2852a View commit details
    Browse the repository at this point in the history
  5. [ios, macos] Thoroughly dedupe attribution infos

    Also added a test to verify parity with the GL JS implementation. This implementation avoids sorting.
    1ec5 committed Dec 8, 2016
    Configuration menu
    Copy the full SHA
    9d8036b View commit details
    Browse the repository at this point in the history
  6. [ios, macos] Trim whitespace from attribution strings

    Also added parsing tests.
    1ec5 committed Dec 8, 2016
    Configuration menu
    Copy the full SHA
    b85d48e View commit details
    Browse the repository at this point in the history
  7. [ios, macos] Added attribution parsing tests for styles

    Included an emoji test to ensure that attribution strings are interpreted as UTF-8, to avoid mojibake. Included a test of removing the underline from a leading copyright symbol.
    1ec5 committed Dec 8, 2016
    Configuration menu
    Copy the full SHA
    1c3138e View commit details
    Browse the repository at this point in the history
  8. [ios, macos] Derive feedback link from source

    MGLAttributionInfo now detects feedback links in the attribution HTML code, and it is responsible for tailoring the feedback URL to the current viewport.
    
    Removed the hard-coded feedback action from the attribution sheet on iOS in favor of a source-derived feedback title and URL. Moved the feedback action from macosapp to MGLMapView; applications are now expected to hook an Improve This Map menu item to an MGLMapView action.
    1ec5 committed Dec 8, 2016
    Configuration menu
    Copy the full SHA
    33c7470 View commit details
    Browse the repository at this point in the history