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
Labels
Android
Mapbox Maps SDK for Android
archived
Archived because of inactivity
bug
GL JS parity
For feature parity with Mapbox GL JS
#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 theclass
attribute set tomapbox-improve-map
. On Android, we’re usingHtml.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 thefont-size
CSS property, maybe you could use some other magic style, like a span of 1pt text. 😄/cc @tobrun @friedbunny
The text was updated successfully, but these errors were encountered: