Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Error 401 when running the example #10

Open
SimonCoulombe opened this issue Oct 28, 2020 · 2 comments
Open

Error 401 when running the example #10

SimonCoulombe opened this issue Oct 28, 2020 · 2 comments

Comments

@SimonCoulombe
Copy link

SimonCoulombe commented Oct 28, 2020

library(sf)
library(ggplot2)
library(snapbox)

area <- st_bbox(
  c(xmin = 147, ymin = -43, xmax = 147.7, ymax = -42.65),
  crs = 4326
)

ggplot() +
  layer_mapbox(area, scale_ratio = 0.5)

Error in get_map_image(bbox = mercator_bbox, map_style = map_style, width = width,  : 
  The remote server returned status code 401 in response to the image request

All packages are up to date. Running on kubuntu 20.04

edit: guess it's an issue of setting up a mapbox token, just not sure where to do it.

@anthonynorth
Copy link
Owner

Yes it's likely that it can't find your mapbox access token.
layer_mapbox() takes a mapbox_api_access_token parameter which defaults to Sys.getenv("MAPBOX_ACCESS_TOKEN").

@SimonCoulombe
Copy link
Author

that was it, thanks

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants