Extra Functionality for 'leaflet' Package
are available in the core 'leaflet' package, but there are many more. It is not
possible to support them all in the core 'leaflet' package. This package serves
as an add-on to the 'leaflet' package by providing extra functionality via 'leaflet'
For CRAN version
For latest development version
# We need latest leaflet package from Github, as CRAN package is too old. devtools::install_github('rstudio/leaflet') devtools::install_github('bhaskarvk/leaflet.extras')
Plugins integrated so far ...
- Pulse Icon: Demo at Rpubs - Pulse Icons
- Weather Markers: Demo at Rpubs - Weather Icons
- Leaflet Heat: Demo at Rpubs - Heatmaps
- webgl-heatmap: Demo at Rpubs - Heatmap
- Tile Caching: Demo at Rpubs - Tile Caching
- Leaflet Hash
- Fullscreen Control
- WMS Legend
- Omnivore: Allows adding data from various geospatial file formats.
- Leaflet.Draw & Style Editor: Demo at Rpubs: leaflet-draw
- Leaflet.Geodesic: Demo at Rpubs: Geodesic Lines
- Leaflet-measure-path: Demo at Rpubs: Measure Path
- Leaflet-search: Demo at Rpubs: Leaflet Search
- Leaflet.Sleep: Demo at Rpubs: Suspended Scrolling
- Bing Tiles
- Bounce Marker
The R functions have been documented using roxygen, and should provide enough help to get started on using a feature. However some plugins have lots of options and it's not feasible to document every single detail. In such cases you are encouraged to check the plugin's documentation.
I want to use a certain leaflet plugin not integrated so far.
- Good Solution: Create issues for plugins you wish incorporated but before that search the existing issues to see if issue already exists and if so comment on that issue instead of creating duplicates.
- Better Solution: It would help in prioritizing if you can include additional details like why you need the plugin, how helpful will it be to everyone etc.
- Best Solution: Code it yourself and submit a pull request. This is the fastest way to get a plugin into the package.
I submitted an issue for a plugin long time ago but it is still not available.
This package is being developed purely on a voluntary basis on spare time without any monetary compensation. So the development progress can stall at times. It may also not be possible to prioritize one-off requests that no one else is interested in. Getting more people interested in a feature request will help prioritize development. Other option is to contribute code. That will get you added to the contributer list and a thanks tweet.
I found a bug.
- Good Solution: Search existing issue list and if no one has reported it create a new issue.
- Better Solution: Along with issue submission provide a minimal reproducible code sample.
- Best Solution: Fix the issue and submit a pull request. This is the fastest way to get a bug fixed.
As of version 1.0.0,
leaflet.extras supports leaflet.js version 1.x.
To make additions to the plugin dependencies, please add the plugin using
npm. Make sure it is compiled within the
webpack.config.js. Finally, make sure htmlwidgets finds it within your plugin's dependency function.
To build the latest version of the plugins, please make sure Node.js is installed on your system, then run:
npm install npm run build
Code of Conduct
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Functions in leaflet.extras
|addBounceMarkers||Add Bounce Markers to map|
|addFullscreenControl||Add fullscreen control|
|gpsOptions||Options for the GPS Control|
|addWebGLHeatmap||Add a webgl heatmap|
|addResetMapButton||Reset map's view to original view|
|addWMSLegend||Add WMS Legend|
|debugMap||For debugging a leaflet map|
|addBingTiles||Adds Bing Tiles Layer|
|addAwesomeMarkersDependencies||Add AwesomeMarkers and related lib dependencies to a map|
|enableTileCaching||Enables caching of Tiles|
|addBootstrapDependency||Add Bootstrap dependency to a map|
|addHeatmap||Add a heatmap|
|leaflet.extras||leaflet.extras: Extra Functionality for 'leaflet' Package.|
|pulseIconList||Make pulse-icon set|
|weatherIconList||Make weather-icon set|
|propsToHTML||Converts GeoJSON Feature properties to HTML|
|addSearchFeatures||Add a feature search control to the map.|
|addSearchOSM||Add a OSM search control to the map.|
|searchOptions||Options for search control.|
|drawShapeOptions||Options for drawn shapes|
|addDrawToolbar||Adds a Toolbar to draw shapes/points on the map.|
|leafletExtrasDependencies||Various leaflet dependency functions for use in downstream packages|
|addHash||Add dynamic URL Hash|
|suspendScroll||Prevents accidental map scrolling when scrolling in a document.|
|enableMeasurePath||Enables measuring of length of polylines and areas of polygons|
|addGeoJSONv2||Adds a GeoJSON/TopoJSON to the leaflet map.|
|addStyleEditor||Add style editor|
|addGeodesicPolylines||Add Geodesic Lines|
|License||GPL-3 | file LICENSE|
|imports||htmltools , htmlwidgets , magrittr , stringr|
|suggests||jsonlite , readr|
|depends||leaflet (>= 2.0.0) , R (>= 3.1.0)|
|Contributors||Bangyou Zheng, Mike Bostock, Vladimir Agafonkin, Barret Schloerke, Robin Cura, Markus Voge, Markus Dumke, Mapbox, Henry Thasler, Dennis Wilhelm, Kirollos Risk, Tim Wisniewski, Leaflet, Alexander Milevski, John Firebaugh, Stefano Cudini, Johannes Rudolph, Per Liedman, Pavel Shramov, Filip Zavadil, CliffCloud, Ursudio, Maxime Hadjinlian, Iv<c3><a1>n S<c3><a1>nchez Ortega, Dale Harvey|
Include our badge in your README