Quick Example - Mapping Grafton St Branch

---
title: "Grafton St. Branch"
output:
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
    source_code: embed
    self_contained: true
---
 
### Quick Example - Mapping Grafton St Branch
```{r echo=FALSE}
 
#############################################
# Start
#############################################
 
# Load libraries
# install.packages("leaflet")
library(flexdashboard)
library(leaflet)
library(leaflet.extras)
 
 
 
# Create leaflet map widget
leaflet() %>%
 
# Add bootstrap dependency (not 100% sure why, but has nicer CSS for )
addBootstrapDependency() %>%
 
# Add a 'home' button
addEasyButton(easyButton(
  icon="fa-globe", title="Reset View",
  onClick=JS("function(btn, map){map.setView([53.43, -7.78], 7);}"))) %>%
 
# Add fullscreen control
addFullscreenControl(position = "topleft") %>%   
  
# Add map tiles
# (More found here https://leaflet-extras.github.io/leaflet-providers/preview/)
addProviderTiles("CartoDB.Positron", group = "Greyscale") %>%
addProviderTiles("NASAGIBS.ViirsEarthAtNight2012", group = "Night Lights") %>%
addProviderTiles("Esri.WorldImagery", group = "Satellite") %>%
 
# Add some spatial data
# (href attribute is gone missing in popup)
addMarkers(-6.259644, 53.342966, popup = paste("Grafton St. Branch")
) %>%
 
# Add some controls to the map
addLayersControl(
    baseGroups = c("Greyscale", "Night Lights", "Satellite"),
    options = layersControlOptions(collapsed = FALSE)
    )
 
#############################################
# End
#############################################
```