mapbox / mapbox-gl-js

Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL
https://docs.mapbox.com/mapbox-gl-js/
Other
11.05k stars 2.21k forks source link

Duplicate attribution #1804

Open planemad opened 8 years ago

planemad commented 8 years ago

We're having this issue on the Chennai flood map after adding the mapbox.satellite layer.

screenshot 2015-12-05 08 45 39
mourner commented 8 years ago

I'm not sure we can fix this automatically — it grabs attribution strings from corresponding TileJSON of both sources, and it's not a 1:1 match. Perhaps we could detect whether one attribution is a substring of another one and then use the bigger one.

lucaswoj commented 8 years ago

We're due for an overhaul of our attribution system #1485. Perhaps we could support a per-source attribution syntax like

attribution: ["© Mapbox", "© OpenStreetMap", "© Digital Globe"]

So that we can better merge and dedupe strings

mourner commented 8 years ago

@lucaswoj but that would require changing the TileJSON spec and propagating that change through our whole stack, right? Substring matching may be good enough of a hack for now.

lucaswoj commented 8 years ago

Right. Substring matching sounds like a better short-term solution.

jfirebaugh commented 8 years ago

See also #1752.

lucaswoj commented 8 years ago

This was partially addressed by https://github.com/mapbox/mapbox-gl-js/commit/d7dacd63937b0429df46b8279a75090727501efd and I have not heard any reqests for refinements since.

Related to #1485

1ec5 commented 8 years ago

A more structured attribution syntax like the one described in https://github.com/mapbox/mapbox-gl-js/issues/1804#issuecomment-162717387 is being tracked in mapbox/tilejson-spec/issues/20.

SnailBones commented 1 year ago

This is still affecting some maps.

ygoe commented 1 month ago

I see this all the time here. Is there something I can do in my code?

romankaravia commented 1 month ago

Looks like this is currently happening with Light, Dark, Streets, and Outdoors styles, also on https://mapbox.com, see e.g. Light style preview:

image

However, this seems to be a backend issue, e.g. the Light style internally depends on multiple sources, which are loaded from https://api.mapbox.com/v4/mapbox.mapbox-streets-v8,mapbox.mapbox-terrain-v2,mapbox.mapbox-bathymetry-v2.json?secure&access_token={access_token}, which returns a style document that starts as follows:

{
  "attribution": "\u003Ca href=\"https://www.mapbox.com/about/maps/\" target=\"_blank\" title=\"Mapbox\" aria-label=\"Mapbox\"\u003E© Mapbox\u003C/a\u003E \u003Ca href=\"https://www.openstreetmap.org/about/\" target=\"_blank\" title=\"OpenStreetMap\" aria-label=\"OpenStreetMap\"\u003E© OpenStreetMap\u003C/a\u003E \u003Ca href=\"https://www.mapbox.com/about/maps/\" target=\"_blank\" title=\"Mapbox\" aria-label=\"Mapbox\"\u003E© Mapbox\u003C/a\u003E \u003Ca href=\"https://www.openstreetmap.org/about/\" target=\"_blank\" title=\"OpenStreetMap\" aria-label=\"OpenStreetMap\"\u003E© OpenStreetMap\u003C/a\u003E \u003Ca class=\"mapbox-improve-map\" href=\"https://www.mapbox.com/contribute/\" target=\"_blank\" title=\"Improve this map\" aria-label=\"Improve this map\"\u003EImprove this map\u003C/a\u003E",
  "bounds": [-180, -85, 180, 85],
  "center": [0, 0, 0],

Highlight of the link to Mapbox being duplicated in the above attribution string:

image

=> I'm just commenting this here to say that it looks like this is likely not an issue with mapbox-gl-js, if anyone feels like it, you could try reporting this somewhere else at Mapbox (probably customer support, or your backend colleagues, in case you work at Mapbox).

mhemmings commented 1 week ago

We've also started seeing this a lot in the last few weeks. And it's very inconsistent, can go hours/days without seeing it and then it'll happen again. Assume a backend change somewhere has caused it?

mourner commented 1 week ago

@mhemmings yes, you might be seeing remnants of cached responses after the glitch was introduced on the API side (and later fixed). Whenever you see it again, please report the specific cases so that we can investigate.