Leaflet 1.1.0 is now available on CRAN! The Leaflet package is a tidy wrapper for the Leaflet.js mapping library, and makes it incredibly easy to generate interactive maps based on spatial data you have in R.
This release was nearly a year in the making, and includes many important new features.
- Easily add textual labels on markers, polygons, etc., either on hover or statically
- Highlight polygons, lines, circles, and rectangles on hover
- Markers can now be configured with a variety of colors and icons, via integration with Leaflet.awesome-markers
- Built-in support for many types of objects from
sf, a new way of representing spatial data in R (all basic
GEOMETRYCOLLECTIONare directly supported)
- Projections other than Web Mercator are now supported via Proj4Leaflet
- Color palette functions now natively support viridis palettes; use
"plasma"as the palette argument
- Discrete color palette functions (
colorFactor) work much better with color brewer palettes
- Integration with several Leaflet.js utility plugins
- Data with
NApoints or zero rows no longer causes errors
- Support for linked brushing and filtering, via Crosstalk (more about this to come in another blog post)
Many thanks to @bhaskarvk who contributed much of the code for this release.
Going forward, our intention is to prevent any more Leaflet.js plugins from accreting in the core leaflet package. Instead, we have made it possible to write 3rd party R packages that extend leaflet (though the process to do this is not documented yet). In the meantime, Bhaskar has started developing his own leaflet.extras package; it already supports several plugins, for everything from animated markers to heatmaps.