Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/be-marc/leaflet.opacity
Leaflet for R Opacity Controls
https://github.com/be-marc/leaflet.opacity
Last synced: 4 months ago
JSON representation
Leaflet for R Opacity Controls
- Host: GitHub
- URL: https://github.com/be-marc/leaflet.opacity
- Owner: be-marc
- Created: 2018-11-07T09:54:27.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-08-15T12:51:12.000Z (over 1 year ago)
- Last Synced: 2024-10-11T18:19:07.421Z (4 months ago)
- Language: R
- Size: 1.25 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.Rmd
Awesome Lists containing this project
- awesome-leaflet - leaflet.opacity: Leaflet for R Opacity Controls
- awesome-shiny-extensions - leaflet.opacity - Opacity controls for Leaflet maps. (Visualization / Maps and Spatial Data)
README
---
output: github_document
---```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# leaflet.opacity# General
**leaflet.opacity** extends the **leaflet** R package with the **Leaflet.OpacityControls** JavaScript plugin (LizardTech, 2013). It offers control buttons and a slider for adjusting the opacity of a layer.
## Installation
You can install the released version of leaflet.opacity from [CRAN](https://CRAN.R-project.org) with:
```{r, eval=FALSE}
install.packages("leaflet.opacity")
```or the latest version from GitHub with:
```{r, eval=FALSE}
devtools::install_github("https://github.com/be-marc/leaflet.opacity", dependencies=TRUE)
```## Example
```{r, eval=FALSE}
library(leaflet)
library(leaflet.opacity)
library(raster)r <- raster(xmn = -2.8, xmx = -2.79, ymn = 54.04, ymx = 54.05, nrows = 30, ncols = 30)
values(r) <- matrix(1:900, nrow(r), ncol(r), byrow = TRUE)
crs(r) <- CRS("+init=epsg:4326")leaflet() %>%
addTiles() %>%
addRasterImage(r, layerId = "raster") %>%
addOpacitySlider(layerId = "raster")
```## Reference
LizardTech (2013). Leaflet.OpacityControls. Retrieved from https://github.com/lizardtechblog/Leaflet.OpacityControls