Skip to content
This repository has been archived by the owner on Apr 10, 2018. It is now read-only.

Allow an "attribution" property on sources #380

Closed
lucaswoj opened this issue Nov 20, 2015 · 5 comments
Closed

Allow an "attribution" property on sources #380

lucaswoj opened this issue Nov 20, 2015 · 5 comments

Comments

@lucaswoj
Copy link

We should allow an attribution property on sources to specify custom attribution.

"geojson-marker": {
  "type": "geojson",
  "attribution": "© John Doe",
  "data": {
    "type": "Feature",
    "geometry": {
      "type": "Point",
      "coordinates": [-77.0323, 38.9131]
    },
    "properties": {
      "title": "Mapbox DC",
      "marker-symbol": "monument"
    }
  }
}

cc @mourner @jfirebaugh @yhahn @tmcw

ref mapbox/mapbox-gl-js#1485

@lucaswoj
Copy link
Author

We will need to be careful about XSS attacks using the attribution. Instead of allowing HTML, we could hit the most common use case (a link to a page explaining the attribution) by supporting attribution and attributionHref properties.

@tristen
Copy link
Member

tristen commented Feb 14, 2016

Ahh it would be nice if this was flexible which a attribution and attributionHref value would limit. like:

Data layer by x and y.

Would it make sense for this to be an attribution plugin control (so opt-in) that sanitizes HTML?

@jfirebaugh
Copy link
Contributor

Based on our experience with sanitization in Mapbox.js, it's something that we should avoid at all costs.

If you want totally custom attribution, you can always add your own <div> and CSS.

@1ec5
Copy link
Contributor

1ec5 commented Dec 20, 2016

We will need to be careful about XSS attacks using the attribution.

How would this be any different than using attribution in a TileJSON file or an inline raster source as an attack vector? It seems like this is an orthogonal concern that would be addressed by something like mapbox/tilejson-spec#20. In the meantime, I think we should give all sources the same attribution mechanism.

@lucaswoj lucaswoj changed the title Allow an attribution property on sources Allow an "attribution" property on sources Dec 22, 2016
@lucaswoj
Copy link
Author

lucaswoj commented Feb 1, 2017

Merged into mapbox/mapbox-gl-js#1485

@lucaswoj lucaswoj closed this as completed Feb 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants