Skip to content

Commit 9a636af

Browse files
committed
place/replace open-street-map attribution in carto and stamen styles
1 parent b5338fe commit 9a636af

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

src/plots/mapbox/constants.js

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
var requiredVersion = '1.10.1';
44

5+
var OSM = '<a href="https://www.openstreetmap.org/copyright" target="_blank">© OpenStreetMap</a> contributors';
6+
57
var stylesNonMapbox = {
68
'open-street-map': {
79
id: 'osm',
810
version: 8,
911
sources: {
1012
'plotly-osm-tiles': {
1113
type: 'raster',
12-
attribution: '<a href="https://www.openstreetmap.org/copyright" target="_blank">© OpenStreetMap</a> contributors',
14+
attribution: OSM,
1315
tiles: [
1416
'https://a.tile.openstreetmap.org/{z}/{x}/{y}.png',
1517
'https://b.tile.openstreetmap.org/{z}/{x}/{y}.png'
@@ -43,7 +45,10 @@ var stylesNonMapbox = {
4345
sources: {
4446
'plotly-carto-positron': {
4547
type: 'raster',
46-
attribution: '<a href="https://carto.com/" target="_blank">© CARTO</a>',
48+
attribution: [
49+
OSM,
50+
'<a href="https://carto.com/" target="_blank">© CARTO</a>'
51+
].join(', '),
4752
tiles: ['https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png'],
4853
tileSize: 256
4954
}
@@ -62,7 +67,10 @@ var stylesNonMapbox = {
6267
sources: {
6368
'plotly-carto-darkmatter': {
6469
type: 'raster',
65-
attribution: '<a href="https://carto.com/" target="_blank">© CARTO</a>',
70+
attribution: [
71+
OSM,
72+
'<a href="https://carto.com/" target="_blank">© CARTO</a>'
73+
].join(', '),
6674
tiles: ['https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png'],
6775
tileSize: 256
6876
}
@@ -81,7 +89,10 @@ var stylesNonMapbox = {
8189
sources: {
8290
'plotly-stamen-terrain': {
8391
type: 'raster',
84-
attribution: 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> | Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="https://www.openstreetmap.org/copyright">ODbL</a>.',
92+
attribution: [
93+
OSM,
94+
'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>'
95+
].join(', '),
8596
tiles: ['https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png'],
8697
tileSize: 256
8798
}
@@ -100,7 +111,10 @@ var stylesNonMapbox = {
100111
sources: {
101112
'plotly-stamen-toner': {
102113
type: 'raster',
103-
attribution: 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> | Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="https://www.openstreetmap.org/copyright">ODbL</a>.',
114+
attribution: [
115+
OSM,
116+
'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>'
117+
].join(', '),
104118
tiles: ['https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png'],
105119
tileSize: 256
106120
}
@@ -119,7 +133,10 @@ var stylesNonMapbox = {
119133
sources: {
120134
'plotly-stamen-watercolor': {
121135
type: 'raster',
122-
attribution: 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> | Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>.',
136+
attribution: [
137+
OSM,
138+
'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>'
139+
].join(', '),
123140
tiles: ['https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png'],
124141
tileSize: 256
125142
}

0 commit comments

Comments
 (0)