leaflegend
1.3.0Add Custom Legends to 'leaflet' Maps
Overview
Provides extensions to the 'leaflet' package to customize legends with images, text styling, orientation, sizing, and symbology and functions to create symbols to plot on maps.
- added
makeSymbolTextandmakeSymbolTextIconsfor building SVG text
symbols that can be used as 'leaflet' icons. Unlike the existing 'text'
shape in makeSymbol, these take an explicit text argument so each
symbol can show a different label. fontSize and fontFamily arguments
are exposed.
- added
addTextandaddTextSizeas convenience wrappers analogous to
addSymbols and addSymbolsSize for placing text symbols on a map.
- added
addLegendTextandaddLegendTextSizefor legend support of
text symbols, analogous to addLegendSymbol and addLegendSize.
addLegendText exposes both fontSize and fontFamily;
addLegendTextSize exposes only fontFamily and auto-computes
font-size from each break's width. addLegendText takes an optional
Show all changes in 1.3.0Hide the rest of the changes in 1.3.0
labels argument; by default no labels are placed beside the text symbols.
addLegendTextSize requires a single text string that is rendered at
each break size.
- corrected the
...documentation formapSymbols,legendSymbols, and
addLeafLegends. The grouped help pages now state which pass-through
target applies to each function in the group.
- Fixed legends with a
groupnot matching the state of the layers control
when the map renders inside an initially hidden container, e.g. an inactive
Quarto/bslib tab or a hidden Shiny tab (#110). Legend visibility now re-syncs
after deferred rendering completes and also responds to showGroup/
hideGroup.
- Fixed
addLegendNumericplacing ticks and labels at mirrored positions on
vertical legends so that they did not align with the color gradient when
breaks were not symmetric within the range of values (#105, #106).
- Fixed
addLegendNumericwithdecreasing = TRUEnot reversing the color
gradient, which left labels in the opposite order of the colors.
- User supplied
labelsinaddLegendNumericnow always pair with the bins
in ascending order of value for both orientations, e.g. for
bins = c(1000, 3000, 6000) and labels = c('low', 'med', 'high'), 'low'
labels the 1000 tick even when decreasing = TRUE.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
- OK13 OK2026-05-24
Show 1 earlier changeHide 1 earlier change
- NOTE3 OK, 11 NOTE2026-03-10
Documentation
- Help pages
- 6
- Examples that run
- 100%5 run in a plain check
- Exported functions with examples
- 83%
- Documented parameters
- 88%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 97%
- Median days to close, 50 most recently updated closed issues
- 8
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
10 development-tooling and community-health practices detected across 6 families in the upstream repository
Checks run against github.com/tomroh/leaflegend on 2026-10-11.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Funding links: GitHub Sponsors
The repository owner accepts GitHub Sponsors
GitHub Pages site last deployed 2021-07-11
pkgdown site last built 2026-09-16
Show all practicesHide 2 practices
Dependencies
Installing leaflegend adds 50 packages (30 with compiled code, 47 MB of source tarballs). Heaviest: sf 9.3 MB, bslib 5.6 MB, sp 4.3 MB.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 1.3.0Latest2026-09-16 · current release · diff ↗ ·
added 6 exports
addLegendText, addLegendTextSize, addText, addTextSize, makeSymbolText, makeSymbolTextIcons - 1.2.82026-05-16 · diff ↗
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- 1.2.12024-05-09 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 1.2.02024-01-10 · diff ↗
- 1.1.12023-08-19 · diff ↗
- 1.1.0
- RR 4.3.0 released · 2023-04-21
- 1.0.02022-08-05 · diff ↗ ·
removed 1 export
makeSizeIconsadded 4 exports
addLegendSymbol, addSymbols, addSymbolsSize, makeSymbolsSize - RR 4.2.0 released · 2022-04-22
- 0.6.12022-03-03 · diff ↗
- 0.6.0
- 0.5.0
- 0.4.02021-07-23 · diff ↗
Package metadata
- First published
- 2021-01-25
- Total releases
- 14 / 5 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 3.3.0
- Download size
- 1.3 MB
Cite
Cite this package
Run in R for the authors' entry:
citation("leaflegend")The package provides a citation file, so citation() returns the authors' own entry.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-17, which the citation names so these numbers can be found later. More on citing and the projects behind them.