mapbox / mapbox/tilejson-spec

Structured attribution

Open
#20 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

v4
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.