Learn R Programming

simplevis (version 3.0.0)

leaflet_basemap: Basemap stack in leaflet.

Description

Make a stack of leaflet baselayers for use in shiny apps.

Usage

leaflet_basemap(top_layer = "light", bounds = NULL)

Arguments

top_layer

The first layer to start in the basemap stack. Either "light", "dark", "street", "satellite", or "ocean". Defaults to "light".

bounds

A bbox object or numeric vector of length four, with xmin, ymin, xmax and ymax values in WGS84 (epsg 4326).

Value

A leaflet object.

Examples

Run this code
# NOT RUN {
leaflet_basemap("dark")

leaflet_basemap(bounds = c(166.70047,-34.45676, 178.52966,-47.06345))

bb <- rnaturalearth::ne_countries(scale = "small", 
           country = "Papua New Guinea", 
           returnclass = "sf") %>% 
     sf::st_bbox() 

leaflet_basemap("satellite", bounds = bb)  
# }

Run the code above in your browser using DataLab