Closed bpb824 closed 2 years ago
@bpb824 I can add this in the next version. You are looking for something similar to addLegendSize
but only changes the weight of the line height but not the line width?
Precisely -- something that can be used to represent flow data on a polyline. I use your package to map transit data for example, and I want to be able to show passenger load observed on segments of a bus route using the weight
attribute of Leaflet's polyline shape. Thank you!
devtools::install_github('tomroh/leaflegend@devel')
library(leaflet)
library(leaflegend)
data("atlStorms2005")
baseSize <- 10
lineColor <- '#00000080'
pal <- colorNumeric('Reds', atlStorms2005$MinPress)
leaflet() |>
addTiles() |>
addPolylines(data = atlStorms2005,
weight = ~sizeNumeric(values = MaxWind, baseSize = baseSize),
color = ~pal(MinPress),
popup = ~as.character(MaxWind)) |>
addLegendLine(values = atlStorms2005$MaxWind,
title = 'MaxWind',
baseSize = baseSize,
width = 50,
color = lineColor) |>
addLegendNumeric(pal = pal,
title = 'MinPress',
values = atlStorms2005$MinPress)
I added in a new function and this should solve the issue.
Thank you!!!
fda701250eb7cc568f895c43778f6d9790ae2254
Do you plan to add an implementation of this for the width/weight of polylines? I haven't seen any other package do it yet, and it seems like it would not be that hard from what you have already set up.