weatherIconList | R Documentation |
Make weather-icon set
Make Weather Icon
An icon can be represented as a list of the form list(icon, markerColor,
...)
. This function is vectorized over its arguments to create a list of
icon data. Shorter argument values will be re-cycled. NULL
values for
these arguments will be ignored.
Add Weather Markers
weatherIconList(...)
## S3 method for class 'leaflet_weather_icon_set'
x[i]
makeWeatherIcon(icon, markerColor = "red", iconColor = "white",
extraClasses = NULL)
weatherIcons(icon, markerColor = "red", iconColor = "white",
extraClasses = NULL)
addWeatherMarkers(map, lng = NULL, lat = NULL, layerId = NULL,
group = NULL, icon = NULL, popup = NULL, popupOptions = NULL,
label = NULL, labelOptions = NULL, options = leaflet::markerOptions(),
clusterOptions = NULL, clusterId = NULL,
data = leaflet::getMapData(map))
... |
icons created from |
x |
icons |
i |
offset |
icon |
the weather icon name w/o the "wi-" prefix. For a full list see https://erikflowers.github.io/weather-icons/ |
markerColor |
color of the marker |
iconColor |
color of the weather icon |
extraClasses |
Character vector of extra classes. |
map |
the map to add weather Markers to. |
lng |
a numeric vector of longitudes, or a one-sided formula of the form
|
lat |
a vector of latitudes or a formula (similar to the |
layerId |
the layer id |
group |
the name of the group the newly created layers should belong to
(for |
popup |
a character vector of the HTML content for the popups (you are
recommended to escape the text using |
popupOptions |
options for popup |
label |
a character vector of the HTML content for the labels |
labelOptions |
A Vector of |
options |
a list of extra options for tile layers, popups, paths (circles, rectangles, polygons, ...), or other map elements |
clusterOptions |
if not |
clusterId |
the id for the marker cluster layer |
data |
the data object from which the argument values are derived; by
default, it is the |
iconSet = weatherIconList(
hurricane = makeWeatherIcon(icon = "hurricane"),
tornado = makeWeatherIcon(icon = "tornado")
)
iconSet[c("hurricane", "tornado")]
leaflet() %>%
addTiles() %>%
addWeatherMarkers(
lng = -118.456554, lat = 34.078039,
label = "This is a label",
icon = makeWeatherIcon(
icon = "hot",
iconColor = "#ffffff77",
markerColor = "blue"
)
)
## for more examples see
# browseURL(system.file("examples/weatherIcons.R", package = "leaflet.extras"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.