forked from jlhapp/Basic_Mapping
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Basemaps.R
28 lines (23 loc) · 945 Bytes
/
Basemaps.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#Different types of basemaps available for leaflet. For full list:
#http://leaflet-extras.github.io/leaflet-providers/preview/index.html
library(leaflet)
library(magrittr)
#Add leaflet, set view, and add tiles
m <- leaflet() %>%
setView(lng = -71.0589, lat = 42.3601, zoom = 8) %>%
addTiles()
m
#Some examples
m %>% addProviderTiles("NASAGIBS.ViirsEarthAtNight2012")
m %>% addProviderTiles("NASAGIBS.ModisTerraLSTDay")
m %>% addProviderTiles("Thunderforest.TransportDark")
m %>% addProviderTiles("HikeBike.HikeBike")
m %>% addProviderTiles("MtbMap")
#to set a specific date, addTile and then addProvider tiles. Set the basemap
#you want followed by a comma, and then options = providerTileOptions(time = )
m2 <- leaflet() %>%
setView(lng = 4.5, lat = 51, zoom = 1) %>%
addTiles() %>%
addProviderTiles("NASAGIBS.ModisTerraTrueColorCR",
options = providerTileOptions(time = "2015-07-31", opacity = 0.5))
m2