diff --git a/docs/404.html b/docs/404.html index a5741c2..cba0159 100644 --- a/docs/404.html +++ b/docs/404.html @@ -95,7 +95,7 @@
diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index ed52ee5..8106f32 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -95,7 +95,7 @@ diff --git a/docs/LICENSE.html b/docs/LICENSE.html index ba08120..ee8f5fc 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -95,7 +95,7 @@ diff --git a/docs/authors.html b/docs/authors.html index 475a781..575faaf 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -95,7 +95,7 @@ diff --git a/docs/index.html b/docs/index.html index 304615c..b439996 100644 --- a/docs/index.html +++ b/docs/index.html @@ -48,7 +48,7 @@ @@ -149,6 +149,11 @@NEWS.md
+ adding addLegendAwesomeIcon function to produce legends with markers from awesome icon libraries
adding in line and polygon symbol and adding symbols to the README
Add a legend with Awesome Icons
+addLegendAwesomeIcon( + map, + iconSet, + title = NULL, + labelStyle = "", + orientation = c("vertical", "horizontal"), + marker = TRUE, + group = NULL, + className = "info legend leaflet-control", + ... +)+ +
map | +a map widget object created from 'leaflet' |
+
---|---|
iconSet | +a named list from awesomeIconList, the names will be the labels in the legend |
+
title | +the legend title, pass in HTML to style |
+
labelStyle | +character string of style argument for HTML text |
+
orientation | +stack the legend items vertically or horizontally |
+
marker | +whether to show the marker or only the icon |
+
group | +group name of a leaflet layer group |
+
className | +extra CSS class to append to the control, space separated |
+
... | +arguments to pass to addControl |
+
an object from addControl
+ ++library(leaflet) +data(quakes) +iconSet <- awesomeIconList( + `Font Awesome` = makeAwesomeIcon(icon = "font-awesome", library = "fa", + iconColor = 'gold', markerColor = 'red', + spin = FALSE, + squareMarker = TRUE, + iconRotate = 30, + ), + Ionic = makeAwesomeIcon(icon = "ionic", library = "ion", + iconColor = '#fffff', markerColor = 'blue', + spin = TRUE, + squareMarker = FALSE), + Glyphicon = makeAwesomeIcon(icon = "plus-sign", library = "glyphicon", + iconColor = 'rgb(192, 255, 0)', markerColor = 'darkpurple', + spin = TRUE, + squareMarker = FALSE) +) +leaflet(quakes[1:3,]) |> + addTiles() |> + addAwesomeMarkers(lat = ~lat, + lng = ~long, + icon = iconSet) |> + addLegendAwesomeIcon(iconSet = iconSet, + orientation = 'horizontal', + title = htmltools::tags$div( + style = 'font-size: 20px;', + 'Awesome Icons'), + labelStyle = 'font-size: 16px;') |> + addLegendAwesomeIcon(iconSet = iconSet, + orientation = 'vertical', + marker = FALSE, + title = htmltools::tags$div( + style = 'font-size: 20px;', + 'Awesome Icons'), + labelStyle = 'font-size: 16px;') +
Add a legend with Awesome Icons