Skip to content

Latest commit

 

History

History
52 lines (29 loc) · 2.93 KB

README.md

File metadata and controls

52 lines (29 loc) · 2.93 KB

{leaf.magic} - Use Modern Icon Libraries in Leaflet Markers leaf.magic website

CRAN status R-CMD-check

The goal of {leaf.magic} is to overcome the somewhat outdated "Font Awesome" implementation in vanilla R {leaflet} by constructing markers on the fly using {fontawesome} or {bsicons} and {magick}. There are three issues {leaf.magic} sets out to overcome:

  • leaflet::awesomeIcons() is limited to Font Awesome 4 👎

  • leaflet::awesomeIcons() is limited to a handful of discrete colours 👎

  • leaflet::awesomeIcons() is limited to a single marker size 👎

  • Vanilla {leaflet} doesn't provide any additional features to construct legends, icon palettes, or such like 👎

{leaf.magic} attempts to solve all of this:

  • magicIcons() uses up-to-date versions of Font Awesome, Bootstrap, and Ionicons Icons, powered by {fontawesome} and {bsicons}

  • magicIcons() uses {fontawesome} to grab a marker shape, and can therefore colour and resize it however the user desires ✅

  • {leaf.magic} exports functions like iconBin() and addIconLegend() to help developers communicate the meanings of icons to users ✅

{leaf.magic} is thoroughly documented on the package website, which includes a getting started guide.

Installation

You can install the development version of {leaf.magic} like so:

# install.packages("pak")
pak::pak("jack-davison/leaf.magic")

A screenshot of a map produced using the {leaf.magic} R package.

Attributions

{leaf.magic} is licensed under the MIT License, and would not be possible without the following icon libraries:

Code of Conduct

Please note that the leaf.magic project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.