Skip to content

Commit 5487a72

Browse files
author
Joseph Damiba
committed
using correct attribute name for mapbox token
1 parent 9d0ad9c commit 5487a72

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

r/2017-01-19-buttons.Rmd

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,11 @@ When adding buttons to Plotly charts, users have the option of styling the color
330330
```{r}
331331
library(plotly)
332332
333+
mapboxToken <- paste(readLines("../.mapbox_token"), collapse="") # You need your own token
334+
335+
# Setting mapbox token for R environment
336+
Sys.setenv("MAPBOX_TOKEN" = mapboxToken)
337+
333338
# read in wind turbines and farms data
334339
df_wind = read.csv('data/2805.csv')
335340
df_farms = read.csv('https://plot.ly/~jackp/17256.csv', skipNul = TRUE)
@@ -414,7 +419,8 @@ p <- plot_mapbox(df_sub, lat = ~lat_DD, lon = ~long_DD, mode = 'scattermapbox',
414419
yanchor = "bottom",
415420
x = 1,
416421
y = 0,
417-
buttons=list(dark,basic,satellite))))
422+
buttons=list(dark,basic,satellite)))) %>%
423+
config(accesstoken = mapboxToken)
418424
419425
p
420426
```

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ p <- us_cities %>%
171171
style = 'dark',
172172
zoom =2.5,
173173
center = list(lon = -88, lat = 34))) %>%
174-
config(accesstoken = mapboxToken)
174+
config(mapboxAccessToken = mapboxToken)
175175
176176
p
177177
```

0 commit comments

Comments
 (0)