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.

Append camera position to custom feedback links in attribution #8730

Closed

Description

@1ec5

#8630 adds the ability for TileJSON to specify a custom feedback link other than the hard-coded Mapbox Map Feedback tool. However, it only appends the camera position as a hash onto the URL specified by MAP_FEEDBACK_URL, so a custom feedback link that may appear in third-party tile sets wouldn’t go directly to the portion of the map being shown.

GL JS identifies feedback links as <a> tags with the class attribute set to mapbox-improve-map. On Android, we’re using Html.fromHtml(), which doesn’t have a mechanism to inspect the DOM parsed from the HTML code.

The iOS and macOS SDKs faced a similar limitation with the NSAttributedString API, but we came up with a clever workaround that allows us to avoid hard-coding any feedback URL in the SDK. Prepend a <style> tag that uses the .mapbox-improve-map selector to apply a ridiculous style rule that would never occur in real TileJSON but that the HTML parser is able to turn into a character style. Then remove the ridiculous style once everything has been converted into the destination format. In the case of iOS and macOS, it was -webkit-text-stroke-width: 1000px, but if TagSoup understands the font-size CSS property, maybe you could use some other magic style, like a span of 1pt text. 😄

/cc @tobrun @friedbunny

Activity

  1. added
    Android
    GL JS parity
    on Apr 12, 2017
  2. added
    archived
    on Nov 8, 2018
  3. stale commented on Nov 27, 2018

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

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

    AndroidGL JS parityarchivedbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions