1

I got some question about the package "leaflet" which I'm using with Rstudio.

My problem is, that the basemap isn't shown. But at the bottom of the viewer is written "OpenStreeMap" and the options to zoom in and out are also shown.

Somebody knows about this problem?

library(leaflet)
m <- leaflet()
m <- addTiles(m)
m <- addMarkers(m, lng=174.768, lat=-36.852, popup="The birthplace of R")
m

The easy example is shown here: https://rstudio.github.io/leaflet/

Wilcar
  • 2,349
  • 2
  • 21
  • 48
user43348044
  • 305
  • 3
  • 15

2 Answers2

2

I have a solution: If I click in RStudio on "Show in new Window" the map opens in the browser and there I can see it.

Maybe the map only work in the browser?

Ralf Stubner
  • 26,263
  • 3
  • 40
  • 75
user43348044
  • 305
  • 3
  • 15
1

If you are behind a proxy try to add provider info

library(leaflet)
m <- leaflet() %>%
  addTiles(urlTemplate = "http://{s}.tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png", 
       attribution = '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>')
m
Wilcar
  • 2,349
  • 2
  • 21
  • 48