Skip to content

:basecamp:🗺️ Add leaflet base maps the user can switch On / Off

License

Notifications You must be signed in to change notification settings

tidy-MN/basemap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

basemap

:basecamp:🗺️ Add quick leaflet basemaps

Install

To install basemap from Github:

# First install the 'remotes' package
library(remotes)

# Install the basemap package from GitHub
remotes::install_github("tidy-MN/basemap")

Use

Load leaflet and basemap

library(leaflet)
library(basemap)

Now you can use %>% add_basemaps() in your leaflet pipeline.

Light-themed basemap

leaflet(ozone_aqi) %>%
   addCircleMarkers(fillColor = ~aqi_color, 
                    color     = 'gray',
                    fillOpacity = 0.8) %>% 
   add_basemap()


Dark-themed basemap

leaflet(ozone_aqi) %>%
   addCircleMarkers(fillColor = ~aqi_color, 
                    color     = 'gray',
                    fillOpacity = 0.8) %>%   
   add_basemap(dark = TRUE)


Add multiple basemaps with layer controls

leaflet(ozone_aqi) %>%
   addCircleMarkers(fillColor = ~aqi_color, 
                    color     = 'gray',
                    fillOpacity = 0.8) %>%
   add_basemap(layers = TRUE)


About

:basecamp:🗺️ Add leaflet base maps the user can switch On / Off

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages