Structured attribution
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 296
- Forks
- 51
- PR merge metrics
- No merged PRs in 30d
Description
As explained in https://github.com/mapbox/mapbox-gl-native/issues/2723#issuecomment-239383427, native map controls need attribution information in a format other than HTML source code. We should allow the `attribution` property to be set to something more structured that can be converted to the appropriate data structures on the client side. For example, it could be an array of objects, each with a required `title` property (interpreted as literal text) and an optional `url` property (for linking):
``` json
{
"attribution": [
{
"title": "© OpenStreetMap contributors",
"url": "http://www.openstreetmap.org/about/"
},
{
"title": "Creative Commons Attribution-ShareAlike 2.0",
"url": "http://www.openstreetmap.org/copyright/"
}
]
}
```
Other considerations:
- Should the `title` property be localizable? If so, perhaps it should be set to an object mapping ISO 639 language codes to literal strings.
- Mobile clients are often space-constrained. In the example above, it may be advantageous to abbreviate the two items as “© OSM” and “CC BY-SA”. These abbreviations could go in a `short_title` property beside the `title` property.
- Should other formatting be allowed? The current specification doesn’t disallow any HTML tags, so it’s theoretically possible to boldface text or embed images. While such content may be feasible in Web clients, native clients may have difficulty displaying it.
- Perhaps there should be a separate `feedback` property beside the `attribution` property. Many TileJSON documents hosted by Mapbox include an “Improve This Map” link alongside copyright statements. Native clients may want to open an alternative map feedback tool (mapbox/mapbox-gl-native#6001); as things stand, they’d have to look for and omit a specific URL. In space-constrained environments, the client may choose to omit feedback items from the attribution UI to ensure that all the legally required copyright statements are visible.
/cc @kkaefer @jfirebaugh
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the TileJSON specification and the linked discussion about native map controls. Resolve the structured attribution schema, including localization, short titles, formatting, and feedback handling, then document the agreed format and its compatibility expectations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100