rstudio / leaflet

R Interface to Leaflet Maps
http://rstudio.github.io/leaflet/
Other
805 stars 509 forks source link

Map not rendering in RStudio, ... unless wrapped in reprex! #663

Open mlduarte opened 4 years ago

mlduarte commented 4 years ago

Okay - -this is weird. If I wrap my code in reprex::reprex() I can see the map and output in the RStudio Viewer. Running the code alone, all I get is a grey plot with + /- (zoom in/out) buttons. Even if I click on Show in new window, I get the same result (a grey plot). The map also does not appear in the output hmtl file.

When running in R (not Rstudio), the map opens up in my browser and shows correctly.

I have the following in my YAML:


title: "My Title" output: html_document always_allow_html: yes

Any ideas on what is happening here?

library(leaflet)
leaflet() %>% addTiles()


m = leaflet() %>% addTiles()
m = m %>% setView(-93.65, 42.0285, zoom = 17)
m %>% addPopups(-93.65, 42.0285, 'Here is the <b>Department of Statistics</b>, ISU') %>%
  addProviderTiles(providers$OpenStreetMap)

Created on 2020-01-28 by the reprex package (v0.3.0)

ChuliangXiao commented 4 years ago

I am having the same issue.

library(leaflet)
map <- leaflet() %>% addTiles()
map
mlduarte commented 4 years ago

This is a proxy issue. If I disconnect from VPN it works. Weird though, that I can run the code in R behind the VPN but not from Rstudio.