# NOT RUN {
if (interactive()) {
library(leaflet)
library(leafem)
library(stars)
tif = system.file("tif/L7_ETMs.tif", package = "stars")
x1 = read_stars(tif)
x1 = x1[, , , 3] # band 3
leaflet() %>%
addTiles() %>%
leafem:::addGeoRaster(
x1
, opacity = 1
, colorOptions = colorOptions(
palette = grey.colors(256)
)
)
}
# }
Run the code above in your browser using DataLab