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

Append camera position to custom feedback links in attribution #8730

Closed
1ec5 opened this issue Apr 12, 2017 · 1 comment
Closed

Append camera position to custom feedback links in attribution #8730

1ec5 opened this issue Apr 12, 2017 · 1 comment
Labels
Android Mapbox Maps SDK for Android archived Archived because of inactivity bug GL JS parity For feature parity with Mapbox GL JS

Comments

@1ec5
Copy link
Contributor

1ec5 commented Apr 12, 2017

#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

@1ec5 1ec5 added Android Mapbox Maps SDK for Android bug GL JS parity For feature parity with Mapbox GL JS labels Apr 12, 2017
@stale stale bot added the archived Archived because of inactivity label Nov 8, 2018
@stale
Copy link

stale bot commented Nov 27, 2018

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

@stale stale bot closed this as completed Nov 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android archived Archived because of inactivity bug GL JS parity For feature parity with Mapbox GL JS
Projects
None yet
Development

No branches or pull requests

1 participant