# NOT RUN {
library(rgdal)
library(sp)
data(eberg_zones)
names(eberg_zones)
## visualize zones using random colors:
kml.file = paste0(tempdir(), "/eberg_zones.kml")
kml(eberg_zones, file.name=kml.file, colorMode = "random")
## with labels:
kml.file2 = paste0(tempdir(), "/eberg_zones2.kml")
kml(eberg_zones, file.name=kml.file2, colour = ZONES,
plot.labpt = TRUE, labels = ZONES, kmz = TRUE, balloon=TRUE)
# }
Run the code above in your browser using DataLab