library(magrittr)
library(leaflet)
library(readxl)
Interactive Maps In a Book!
1 Introduction
This is a book created from markdown and executable code.
Testing Leaflet
Maps into a book! Lets see!
1.1 Libraries
1.2 This is The Data to plot on a map.
<- read_excel("Area of Collection.xlsx")
Area_of_Collection ::paged_table(head(Area_of_Collection)) rmarkdown
And This is the output!
1.3 Map
leaflet(Area_of_Collection) %>%
addTiles() %>%
addMarkers(
lng = ~ Lon,
lat = ~ Lat,
popup = paste0(Area_of_Collection$Name, "<br>", "Market Code: ", Area_of_Collection$`Market Code`),
popupOptions = popupOptions(closeButton = F)
)
1.4 Diffrent Styles
1.4.1 Esri
leaflet(Area_of_Collection) %>%
addProviderTiles(providers$Esri) %>%
addMarkers(
lng = ~ Lon,
lat = ~ Lat,
popup = paste0(Area_of_Collection$Name, "<br>", "Market Code: ", Area_of_Collection$`Market Code`),
popupOptions = popupOptions(closeButton = F)
)
1.4.2 CartoDb
leaflet(Area_of_Collection) %>%
addProviderTiles(providers$CartoDB) %>%
addMarkers(
lng = ~ Lon,
lat = ~ Lat,
popup = paste0(Area_of_Collection$Name, "<br>", "Market Code: ", Area_of_Collection$`Market Code`),
popupOptions = popupOptions(closeButton = F)
)