-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Derive attribution from sources in current style #2723
Comments
👍 |
This is unblocked now that the runtime source API has landed (#5368). The SDKs already manage attribution for the application, so the callback would be provided by the SDK rather than the application. Each SDK will need to intelligently display the attribution string stored in <a href="https://www.mapbox.com/about/maps/" target="_blank">© Mapbox</a> <a href="http://www.openstreetmap.org/about/" target="_blank">© OpenStreetMap</a> <a class="mapbox-improve-map" href="https://www.mapbox.com/map-feedback/" target="_blank">Improve this map</a> We definitely don’t want to display this HTML source code verbatim in the UI, so we’ll need to do some parsing at the SDK level. On iOS, we currently display attribution in an action sheet, with two hard-coded buttons, labeled “© Mapbox” and “© OpenStreetMap” , that open the appropriate URLs. There is also an “Improve This Map” button. On macOS, we display attribution much as GL JS does, but implemented as a row of NSButtons that open the appropriate URLs. On each button, the text is underlined except for the copyright symbol, for aesthetic reasons. “Improve This Map” isn’t currently built into the SDK (#5775), but it would go in the Help menu rather than beside the attribution. On both iOS and macOS, we can convert the HTML string into an NSAttributedString using a built-in API (that uses WebKit under the hood). Then we can enumerate the links inside the attributed string, spitting out an action button or NSButton. We’d need special cases for copyright symbols and the redundant “Improve This Map” button. /cc @pveugen @friedbunny |
Maybe it's time to update the TileJSON specification and augment the |
@1ec5 As you said, convention on platforms with larger viewport sizes (e.g., desktop and web) is to show these copyright notices directly on the map. I’m not sure if you’re suggesting we do that on mobile, but if so, I don’t think that’s feasible. On iOS, I’d love to replace the current actionsheet with something better: a custom view, which would allow us more control over appearance and content. We’ve not gone the custom view route because of worries about polluting the host application’s view hierarchy (or making incorrect assumptions about it), but perhaps we should investigate this again. |
On iOS, the problem with a modal view remains: that it’ll either be boxed in by the map view (which can be relatively small), making it not really a modal, or it’ll hitch onto the host view controller, which opens the SDK up to all sorts of fragility because not everyone displays a full-screen map view alone in a view controller. In any case, changing the presentation of attribution is out of scope for this ticket. #2723 (comment) is simply about detailing the requirements for the current presentation on each platform, and how we’d achieve “data-driven” attribution instead of the hard-coded attribution we have now. |
Agreed that we can have a specific design discussion later. @kkaefer’s suggestions sound sufficiently modular and we should be able to make better decisions if/once that is available. |
The structured attribution proposed for TileJSON in #2723 (comment) would be a welcome change. In the meantime, in #5999, I’ve implemented dynamic attribution that parses the HTML source code provided by existing TileJSON documents. |
Tracking structured attribution in TileJSON in mapbox/tilejson-spec#20. |
Implemented observer callbacks so the style knows when the source’s attribution changes and the map knows when the style’s attribution changes. Also implemented a getter for a tile source’s attribution. Fixes #2723.
Implemented observer callbacks so the style knows when the source’s attribution changes and the map knows when the style’s attribution changes. Also implemented a getter for a tile source’s attribution. Fixes #2723.
Implemented observer callbacks so the style knows when the source’s attribution changes and the map knows when the style’s attribution changes. Also implemented a getter for a tile source’s attribution. Fixes #2723.
Implemented observer callbacks so the style knows when the source’s attribution changes and the map knows when the style’s attribution changes. Also implemented a getter for a tile source’s attribution. Fixes #2723.
Implemented observer callbacks so the style knows when the source’s attribution changes and the map knows when the style’s attribution changes. Also implemented a getter for a tile source’s attribution. Fixes #2723.
Implemented observer callbacks so the style knows when the source’s attribution changes and the map knows when the style’s attribution changes. Also implemented a getter for a tile source’s attribution. Fixes #2723.
Reopening to track SDK-level support for this feature:
/cc @tobrun |
Fixed for iOS and macOS in #5999. |
PR enabling this for android in #8630 |
We should implement callbacks that notify the embedding applications of changes in attributions. Attributions are included in Sources, and they may change when enabling/disabling tiles from a source depending on the stylesheet, or when setting a new stylesheet that includes different sources.
The text was updated successfully, but these errors were encountered: