# NOT RUN {
 if (interactive()) {
   library(leaflet)
   library(leafem)
   # via URL
   url = "https://raw.githubusercontent.com/bjornharrtell/flatgeobuf/3.0.1/test/data/UScounties.fgb"
   leaflet() %>%
     addTiles() %>%
     leafem:::addFgb(
       url = url
       , group = "counties"
       , label = "NAME"
       , popup = TRUE
       , fill = TRUE
       , fillColor = "blue"
       , fillOpacity = 0.6
       , color = "black"
       , weight = 1
     ) %>%
       addLayersControl(overlayGroups = c("counties")) %>%
       addMouseCoordinates() %>%
       setView(lng = -105.644, lat = 51.618, zoom = 3)
 }
# }
Run the code above in your browser using DataLab