trafficonese / leaflet.extras

Extra functionality for leaflet R package.
https://trafficonese.github.io/leaflet.extras/
GNU General Public License v3.0
211 stars 74 forks source link

addBingTiles() doesn't work? #177

Closed e-clin closed 4 years ago

e-clin commented 4 years ago

I tried to replace the leaflet default (OpenStreetMap) tiles in following code example (taken from the "Leaflet for R" site)

leaflet() %>% setView(lng = -71.0589, lat = 42.3601, zoom = 12) %>% addTiles()

with Bing Maps tiles by

leaflet() %>% setView(lng = -71.0589, lat = 42.3601, zoom = 12) %>% addBingTiles(apikey = Sys.getenv("_MY_KEY_"), imagerySet = "CanvasLight")

but the basemap did not render - I only got a grey canvas.

The syntax of addBingTiles() seems to be simple enough, although I couldn't find a worked example online. Did I miss anything?

Many thanks!

e-clin commented 4 years ago

Oops! Just realised that I copied and pasted the Sys.getenv() from the leaflet.extras manual... -_|||