Learn R Programming

leaflet.extras2 (version 1.3.1)

addOpenweatherCurrent: Add current OpenWeatherMap Marker

Description

Add current OpenWeatherMap Marker

Usage

addOpenweatherCurrent(
  map,
  apikey = NULL,
  group = NULL,
  layerId = NULL,
  options = openweatherCurrentOptions()
)

Value

the new map object

Arguments

map

a map widget object created from leaflet()

apikey

a valid Openweathermap-API key.

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

options

List of further options. See openweatherCurrentOptions

References

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

See Also

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

Examples

Run this code
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
  ))
}

Run the code above in your browser using DataLab