Using a hillshade and the height map, generates a semi-transparent hillshade to layer onto an existing map.

generate_altitude_overlay(
heightmap,
start_transition,
end_transition = NULL,
lower = TRUE
)

## Arguments

hillshade The hillshade to transition into. A two-dimensional matrix, where each entry in the matrix is the elevation at that point. All grid points are assumed to be evenly spaced. Elevation above which hillshade is completely transparent. Default NULL. Elevation below which hillshade is completely opaque. By default, this is equal to start_transition. Default TRUE. This makes hillshade completely opaque below start_transition. If FALSE, the direction will be reversed.

## Value

4-layer RGB array representing the semi-transparent hillshade.

## Examples

#Create a bathymetric hillshade
# \donttest{
water_palette = colorRampPalette(c("darkblue", "dodgerblue", "lightblue"))(200)
bathy_hs = height_shade(montereybay, texture = water_palette)
plot_map(bathy_hs)
#Set everything below 0m to water palette
montereybay %>%
#Add snow peaks by setting lower = FALSE