Skip to content

Instantly share code, notes, and snippets.

@cpsievert
Created December 28, 2016 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cpsievert/07f6fb61239e5ed0ae65c2c93c10d7de to your computer and use it in GitHub Desktop.
Save cpsievert/07f6fb61239e5ed0ae65c2c93c10d7de to your computer and use it in GitHub Desktop.
# setwd("~/Downloads")
readKMZ <- function(f = NULL) {
zip <- paste0(f, ".zip")
file.rename(f, zip)
unzip(zip)
geojsonio::geojson_read("doc.kml", what = "sp")
}
pts <- readKMZ("MWAHIST12282016.kmz")
library(leaflet)
map <- leaflet() %>%
addTiles() %>%
addCircleMarkers(data = pts, label = ~Name, popup = ~Description)
htmlwidgets::saveWidget(map, "MNmap.html")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment