Add Third Party base map tiles addProviderTiles()
We add Third Party base map tiles using addProviderTiles() function.
leaflet() %>%
addProviderTiles(provider = "CartoDB.Positron")
# Following could also be used if you do not want to use the %>% pipe operator
# m = leaflet()
# m = addProviderTiles(map=m, provider = "CartoDB.Positron")
# m
2 or more base map tiles could be used together. We will see more on this later during layer control.
leaflet() %>%
addProviderTiles("Stamen.Watercolor") %>%
addProviderTiles("Stamen.TonerHybrid")
Few other examples of the third party map tiles as well as follows for quick reference:
leaflet() %>%
addProviderTiles("Esri.WorldImagery")
leaflet() %>%
addProviderTiles("Thunderforest.Landscape")
leaflet() %>%
addProviderTiles("Stamen.Toner")
leaflet() %>%
addProviderTiles("Stamen.Watercolor")
leaflet() %>%
addProviderTiles("HikeBike.HikeBike")
leaflet() %>%
addProviderTiles("OpenWeatherMap.Precipitation")
leaflet() %>%
addProviderTiles("MtbMap")
leaflet() %>%
addProviderTiles("NASAGIBS.ModisTerraTrueColorCR")
leaflet() %>%
addProviderTiles("NASAGIBS.ModisTerraTrueColorCR", options=providerTileOptions(time = "2015-12-10", opacity = 0.5))
leaflet()%>% addProviderTiles("MtbMap") %>%
addProviderTiles("Stamen.TonerLines",
options = providerTileOptions(opacity = 0.35)
) %>%
addProviderTiles("Stamen.TonerLabels")