This function adds a shadow to every svg element added to a leaflet map. It can greatly improve the lisibility of the map.

addShadows(map)

Arguments

map

A leaflet map object.

Value

The modified map object

Examples

require(leaflet)
#> Loading required package: leaflet
#> Warning: package 'leaflet' was built under R version 4.2.3
require(leaflet.minicharts)
#> Loading required package: leaflet.minicharts
#> Warning: package 'leaflet.minicharts' was built under R version 4.2.3

leaflet() %>%
  addTiles() %>% 
  addFlows(0, 0, 1, 0, col= gray(0.9)) %>%
  addCircleMarkers(c(0, 1), c(0, 0), color = "white", fillOpacity = 1, stroke = FALSE) %>%
  addShadows()