Description Usage Arguments Author(s) Examples
Add higher opacity control to map
1 | addHigherOpacity(map, layerId)
|
map |
Leaflet map |
layerId |
Opacity layer |
Marc Becker
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # Libraries
library(leaflet)
library(leaflet.opacity)
library(raster)
# Create artificial layer
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")
# Create leaflet map with higher opacity control
leaflet() %>%
addTiles() %>%
addRasterImage(r, layerId = "raster") %>%
addHigherOpacity(layerId = "raster")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.