tomroh / leaflegend

Provides extensions to the leaflet R package to customize legends with images, text styling, orientation, sizing, and symbology.
https://leaflegend.delveds.com
Other
35 stars 3 forks source link

Borders around shapes #11

Closed mtennekes closed 3 years ago

mtennekes commented 3 years ago

Great package! Will definitely use it in tmap.

Question: how can I add borders around the shapes?

tomroh commented 3 years ago

Thanks! much appreciated.

Are you asking for rectangular bordering box around the shapes or an outline around the shape?

s1 <- makeSymbol('circle', width = 24, height = 24, color = 'black', fillColor = 'blue', 'stroke-width' = 2)
leaflet() %>%
  addTiles() %>%
  addLegendImage(images = list(s1), labels = c('outline'))
tomroh commented 3 years ago
library(leaflet)
library(leaflegend)
data("quakes")
quakes <- quakes[1:10,]
mapSymbol <- makeSymbolIcons('circle',color = 'black', 
                fillColor = 'blue',
                width = 10,
                opacity = 1,
                fillOpacity = .5)
leaflet(quakes) %>%
  addTiles() %>%
  addMarkers(icon = mapSymbol)

This will be in the next release. Install from github if you want the feature now.

8afd0a73f856b6de06c38437d27cad9fae299326