Add current OpenWeatherMap Marker
addOpenweatherCurrent(
map,
apikey = NULL,
group = NULL,
layerId = NULL,
options = openweatherCurrentOptions()
)
a map widget object created from leaflet()
a valid Openweathermap-API key.
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
List of further options. See
openweatherCurrentOptions
the new map
object
The current weather icons will appear beginning with zoom level 9
and if used in Shiny, a click on an icon will update a Shiny input at
input$MAPID_owm_click
.
Other Openweathermap Functions:
addOpenweatherTiles()
,
openweatherCurrentOptions()
,
openweatherOptions()
if (FALSE) {
library(leaflet)
library(leaflet.extras2)
Sys.setenv("OPENWEATHERMAP" = 'Your_API_Key')
leaflet() %>%
addTiles() %>% setView(9, 50, 9) %>%
addOpenweatherCurrent(options = openweatherCurrentOptions(
lang = "en", popup = TRUE))
}