You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: r/2019-09-20-mapbox-layers.Rmd
+14-14Lines changed: 14 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,20 @@ library(plotly)
33
33
packageVersion('plotly')
34
34
```
35
35
36
+
### Mapbox Access Tokens and When You Need Them
37
+
38
+
The word "mapbox" in the trace names and `layout.mapbox` refers to the Mapbox.js open-source library. If your basemap in `layout.mapbox.style` uses data from the Mapbox *service*, then you will need to register for a free account at https://mapbox.com/ and obtain a Mapbox Access token. This token should be provided either in `mapboxAccessToken` in `setPlotConfig` function, or as a variable that would be passed as an argument of `newPlot`.
39
+
If your `layout.mapbox.style` does not use data from the Mapbox service, you do *not* need to register for a Mapbox account.
40
+
<h6>Base Maps in `layout.mapbox.style`</h6>
41
+
The accepted values for `layout.mapbox.style` are one of the following tiles.
42
+
<ol>
43
+
<li> `"white-bg"` yields an empty white canvas which results in no external HTTP requests </li>
44
+
<li> `"open-street-map"`, `"carto-positron"`, `"carto-darkmatter"`, `"stamen-terrain"`, `"stamen-toner"` or `"stamen-watercolor"` yeild maps composed of *raster* tiles from various public tile servers which do not require signups or access tokens </li>
45
+
<li> `"basic"`, `"streets"`, `"outdoors"`, `"light"`, `"dark"`, `"satellite"`, or `"satellite-streets"` yeild maps composed of *vector* tiles from the Mapbox service, and *do* require a Mapbox Access Token or an on-premise Mapbox installation. </li>
46
+
<li> A Mapbox service style URL, which requires a Mapbox Access Token or an on-premise Mapbox installation. </li>
47
+
<li> A Mapbox Style object as defined at https://docs.mapbox.com/mapbox-gl-js/style-spec/ </li>
48
+
</ol>
49
+
36
50
### How Layers work in Mapbox Maps
37
51
38
52
If your figure contains one or more traces of type `Scattermapbox`, `Choroplethmapbox` or `Densitymapbox`, the `layout` object in your figure contains configuration information for the map itself. The map is composed of various layers, of three different types.
@@ -131,20 +145,6 @@ p <- us_cities %>%
131
145
p
132
146
```
133
147
134
-
### Mapbox Access Tokens and When You Need Them
135
-
136
-
The word "mapbox" in the trace names and `layout.mapbox` refers to the Mapbox.js open-source library. If your basemap in `layout.mapbox.style` uses data from the Mapbox *service*, then you will need to register for a free account at https://mapbox.com/ and obtain a Mapbox Access token. This token should be provided either in `mapboxAccessToken` in `setPlotConfig` function, or as a variable that would be passed as an argument of `newPlot`.
137
-
If your `layout.mapbox.style` does not use data from the Mapbox service, you do *not* need to register for a Mapbox account.
138
-
<h6>Base Maps in `layout.mapbox.style`</h6>
139
-
The accepted values for `layout.mapbox.style` are one of the following tiles.
140
-
<ol>
141
-
<li> `"white-bg"` yields an empty white canvas which results in no external HTTP requests </li>
142
-
<li> `"open-street-map"`, `"carto-positron"`, `"carto-darkmatter"`, `"stamen-terrain"`, `"stamen-toner"` or `"stamen-watercolor"` yeild maps composed of *raster* tiles from various public tile servers which do not require signups or access tokens </li>
143
-
<li> `"basic"`, `"streets"`, `"outdoors"`, `"light"`, `"dark"`, `"satellite"`, or `"satellite-streets"` yeild maps composed of *vector* tiles from the Mapbox service, and *do* require a Mapbox Access Token or an on-premise Mapbox installation. </li>
144
-
<li> A Mapbox service style URL, which requires a Mapbox Access Token or an on-premise Mapbox installation. </li>
145
-
<li> A Mapbox Style object as defined at https://docs.mapbox.com/mapbox-gl-js/style-spec/ </li>
146
-
</ol>
147
-
148
148
#### Dark Tiles from Mapbox Service: Free Token Needed
149
149
150
150
Here is a map rendered with the `"dark"` style from the Mapbox service, which requires an Access Token:
0 commit comments