Overlays an image (with a transparency layer) on the current map.

add_overlay(
overlay,
alphacolor = NULL,
alphamethod = "max",
alphalayer = 1,
rescale_original = FALSE
)

Arguments

hillshade A three-dimensional RGB array or 2D matrix of shadow intensities. A three or four dimensional RGB array, where the 4th dimension represents the alpha (transparency) channel. If the array is 3D, alphacolor should also be passed to indicate transparent regions. Default NULL. If overlay is a 3-layer array, this argument tells which color is interpretted as completely transparent. Default max. Method for dealing with pre-existing transparency with layeralpha. If max, converts all alpha levels higher than layeralpha to the value set in layeralpha. Otherwise, this just sets all transparency to layeralpha. Default 1. Defines minimum tranparaency of layer. If transparency already exists in overlay, the way add_overlay combines the two is determined in argument alphamethod. Default FALSE. If TRUE, hillshade will be scaled to match the dimensions of overlay (instead of the other way around).

Examples

#Combining base R plotting with rayshader's spherical color mapping and raytracing:
# \dontrun{
montereybay %>%
#Add contours with generate_contour_overlay()
plot_map()#> Warning: replacing previous import ‘vctrs::data_frame’ by ‘tibble::data_frame’ when loading ‘dplyr’