Add weather data to leaflet map.
add_weather(map, data, lng = NULL, lat = NULL, icon = NULL, template = NULL, popup = NULL, ...)
| map |
|
|---|---|
| data | owm data |
| lng | numeric vector of longitudes
(if |
| lat | numeric vector of latitudes
(if |
| icon | vector of owm icon names (usually included in weather column of owm data) |
| template | template in the form of |
| popup | vector containing (HTML) content for popups,
skipped in case parameter |
| ... | see |
updated map object
# NOT RUN { owm_data <- find_city("Malaga", units = "metric") %>% owmr_as_tibble() map <- leaflet() %>% addTiles() %>% add_weather( owm_data, template = "<b>{{name}}</b>, {{temp}}°C", icon = owm_data$weather_icon ) # }