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 = '#ffffff', 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;')
Run the code above in your browser using DataLab