mapbox / tilejson-spec

JSON format for describing map tilesets.
255 stars 52 forks source link

Structured attribution #20

Open 1ec5 opened 8 years ago

1ec5 commented 8 years ago

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):

{
  "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:

/cc @kkaefer @jfirebaugh

kkaefer commented 8 years ago

Should the title property be localizable? If so, perhaps it should be set to an object mapping ISO 639 language codes to literal strings.

Is it realistic that TileJSON producers will include attribution in lots of different languages?

Perhaps there should be a separate feedback property beside the attribution property.

👍

1ec5 commented 8 years ago

Is it realistic that TileJSON producers will include attribution in lots of different languages?

Maybe not lots, but yes, some developers have requested this functionality in the past. (mapbox/mapbox-gl-js#1485 would be a workaround at the map level.)

reyemtm commented 7 years ago

This seems like a perfectly reasonable approach. What's the status of this?

GretaCB commented 6 years ago

Thanks for opening this ticket @1ec5 . This proposed change will be considered as part of the v4 push https://github.com/mapbox/tilejson-spec/issues/35