Skip to content

Commit cfe8120

Browse files
author
Joseph Damiba
committed
moving access token paragraph to top of mapbox-layers example
1 parent 5487a72 commit cfe8120

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

r/2019-09-20-mapbox-layers.Rmd

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,20 @@ library(plotly)
3333
packageVersion('plotly')
3434
```
3535

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+
3650
### How Layers work in Mapbox Maps
3751

3852
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 %>%
131145
p
132146
```
133147

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-
148148
#### Dark Tiles from Mapbox Service: Free Token Needed
149149

150150
Here is a map rendered with the `"dark"` style from the Mapbox service, which requires an Access Token:

0 commit comments

Comments
 (0)