Adding Google snippets using R

I use the leafletR package to create interactive maps, and I would like to use the Google Maps layer. However, Google Maps is not available as an argument to the function addProviderTiles. How to add these google layers using R?

Many thanks!

+4
source share
3 answers

You are looking for a basemap from Google maps. The leaflet currently supports OpenStreetMap, MapQuestOpen, Stamen, Esri, and OpenWeatherMap. If you have access to additional mapping, you can use the WMS plate to service your mapping. No google maps, sorry.

+2

leaflet() %>% addTiles(urlTemplate = "https://mts1.google.com/vt/lyrs=s&hl=en&src=app&x={x}&y={y}&z={z}&s=G", attribution = 'Google')

+4

I was looking for the same too ... As Roman answered, I use the following as an alternative

leaflet(data = data) %>% addMarkers() %>% addTiles(group = "OSM(default)") %>% addProviderTiles("Esri.WorldImagery", group = "ESRI") %>% addProviderTiles("Stamen.Toner", group = "Stamen") %>% addLayersControl(baseGroup = c("OSM(default", "ESRI", "Stamen"))
+1
source

Source: https://habr.com/ru/post/1614603/


All Articles