Adding google tiles with R

眉间皱痕 提交于 2020-03-17 07:28:28

问题


I'm using the leafletpackage with R to generate interactive maps and I would like to use the Google Maps layer. However Google Maps are not available as an argument of the function addProviderTiles. How can I add these google layers with R ?

Thank you very much !


回答1:


You are looking for a base map of from Google maps. Currently leaflet supports OpenStreetMap, MapQuestOpen, Stamen, Esri and OpenWeatherMap. If you have access to extra mapping, you can use a WMS tile to serve your own cartography. No google maps, sorry.




回答2:


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




回答3:


I too was searching for the same... As Roman replied, I am using 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"))


来源:https://stackoverflow.com/questions/33542933/adding-google-tiles-with-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!