Skip to content

Instantly share code, notes, and snippets.

@brainprint
Forked from cpsievert/mapKMZ.R
Created May 1, 2017 13:54
Show Gist options
  • Save brainprint/49d145adceb967183060154dc0877cb6 to your computer and use it in GitHub Desktop.
Save brainprint/49d145adceb967183060154dc0877cb6 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