Last chance! 50% off unlimited learning
Sale ends in
Add OpenWeatherMap Tiles
addOpenweatherTiles(
map,
apikey = NULL,
layers = NULL,
group = NULL,
layerId = NULL,
opacity = 0.5,
options = openweatherOptions()
)
a map widget object created from leaflet()
a valid OpenWeatherMap-API key. Get one from here.
character vector of layers you wish to add to the map. The
following layers are currently possible c("clouds", "cloudsClassic",
"precipitation", "precipitationClassic", "rain", "rainClassic", "snow",
"pressure", "pressureContour", "temperature", "wind")
.
the name of the group the newly created layers should belong to
(for clearGroup
and addLayersControl
purposes).
Human-friendly group names are permitted--they need not be short,
identifier-style names. Any number of layers and even different types of
layers (e.g. markers and polygons) can share the same group name.
the layer id
opacity of the layer
List of further options. See openweatherOptions
the new map
object
Other Openweathermap Functions:
addOpenweatherCurrent()
,
openweatherCurrentOptions()
,
openweatherOptions()
# NOT RUN {
library(leaflet)
library(leaflet.extras2)
Sys.setenv("OPENWEATHERMAP" = 'Your_API_Key')
leaflet() %>%
addTiles() %>% setView(9, 50, 6) %>%
addOpenweatherTiles(layers = "wind")
# }
Run the code above in your browser using DataLab