Closed mtennekes closed 6 years ago
@mtennekes see this issue on leaflet https://github.com/rstudio/leaflet/issues/546. It is a known RStudio problem which should be resolved with the next major release (1.2.x). You can try a daily build from https://dailies.rstudio.com/ and the issue should no longer exist.
I can reproduce this issue on my computer. No basemaps are working for me, e.g.:
qtm(world) +
tm_view(basemaps = leaflet::providers$Thunderforest.OpenCycleMap)
Interestingly it still fails when I pass the output to tmap_leaflet()
but when I do that inside a reprex it works as illustrated below. Interestingly the command above does not render a basemap in the browser either...
Reprex showing it works in a reprex at least (test: try running these - only the commands starting leaflet()
work in RStudio for me:
library(tmap)
library(magrittr)
library(spData)
tmap_mode("view")
#> tmap mode set to interactive viewing
qtm()
#> Error in knit_print(x = structure(list(x = structure(list(options = structure(list(: could not find function "knit_print"
qtm(world) + tm_view(basemaps = leaflet::providers$Thunderforest.OpenCycleMap) %>%
tmap_leaflet()
#> Linking to GEOS 3.5.1, GDAL 2.2.2, proj.4 4.9.2
qtm(world) + tm_view(basemaps = c(leaflet::providers$OpenStreetMap, leaflet::providers$OpenStreetMap.Mapnik)) %>%
tmap_leaflet()
library(leaflet)
leaflet() %>% addTiles()
leaflet() %>% addProviderTiles(leaflet::providers$CartoDB.Positron)
Update in further support of Tim's point: it works from the system command line:
Hey Martijn,
library("tmap")
library("spData")
tmap_mode("view")
qtm(world)
Running this, I can see Esri and OSM tiles but not CartoDB in the RStudio viewer. HTH. All the best, Jannes
Awesome, this type of collaboration, thanks all!
I'll stay with CartoDB then. Probably, RStudio will get this its major release within the next months. Besides, I still like it best for cartography.
Yep, I will also not change though that thought had also crossed my mind. Also, it's also only an issue for quick viewing not for end production HTML which will likely be viewed in the browser anyway.
Update: I've just updated RStudio to the latest version and the cartodb tiles still fail. The other tiles work OK. I suggest others will experience this so suggest changing the default tiles, unless I'm missing something.
Ok, I switched to Esri WorldGrayCanvas, which is almost similar.
PS: it is also possible to set overlay tiles as an option. See https://github.com/mtennekes/tmap/blob/master/examples/tm_tiles.R (dontrun example)
Hi all,
There seems to be an issue with the CartoDB tile servers and RStudio: the tiles are seem to be displayed in an external browser, but not in the RStudio viewer pane, nor in a Shiny app (as @Robinlovelace 's live demo during his eRum2018 talk on wednesday pointed out).
Could you please do me a little favor (@Nowosad @jannes-m @edwindj @Egge-Jan @joelgombin @tim-salabim) and check if you see tiles in RStudio? You can just run this code:
Version 2.0 will be released within a few weeks, and I'm considering changing the default tile server if this problem cannot be resolved.