addLowerOpacity: Add lower opacity control to map

Description Usage Arguments Author(s) Examples

Description

Add lower opacity control to map

Usage

1
addLowerOpacity(map, layerId)

Arguments

map

Leaflet map

layerId

Opacity layer

Author(s)

Marc Becker

Examples

 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 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")

# Create leaflet map with lower opacity control
leaflet() %>%
  addTiles() %>%
  addRasterImage(r, layerId = "raster") %>%
  addLowerOpacity(layerId = "raster")

leaflet.opacity documentation built on May 1, 2019, 9:45 p.m.