addOpenweatherTiles: Add OpenWeatherMap Tiles

View source: R/openweather.R

addOpenweatherTilesR Documentation

Add OpenWeatherMap Tiles

Description

Add OpenWeatherMap Tiles

Usage

addOpenweatherTiles(
  map,
  apikey = NULL,
  layers = NULL,
  group = NULL,
  layerId = NULL,
  opacity = 0.5,
  options = openweatherOptions()
)

Arguments

map

a map widget object created from leaflet()

apikey

a valid OpenWeatherMap-API key. Get one from here.

layers

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").

group

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.

layerId

the layer id

opacity

opacity of the layer

options

List of further options. See openweatherOptions

Value

the new map object

Note

Out of the box a legend image is only available for Pressure, Precipitation Classic, Clouds Classic, Rain Classic, Snow, Temperature and Wind Speed. Please add your own images if you need some more.

References

https://github.com/trafficonese/leaflet-openweathermap

See Also

Other Openweathermap Functions: addOpenweatherCurrent(), openweatherCurrentOptions(), openweatherOptions()

Examples

## Not run: 
library(leaflet)
library(leaflet.extras2)

Sys.setenv("OPENWEATHERMAP" = 'Your_API_Key')

leaflet()  %>%
  addTiles() %>% setView(9, 50, 6) %>%
  addOpenweatherTiles(layers = "wind")

## End(Not run)

leaflet.extras2 documentation built on Aug. 21, 2023, 5:08 p.m.