Open planemad opened 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.
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
@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.
Right. Substring matching sounds like a better short-term solution.
See also #1752.
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
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.
This is still affecting some maps.
I see this all the time here. Is there something I can do in my code?
Looks like this is currently happening with Light, Dark, Streets, and Outdoors styles, also on https://mapbox.com, see e.g. Light style preview:
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:
=> 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).
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?
@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.
We're having this issue on the Chennai flood map after adding the
mapbox.satellite
layer.