writekml | R Documentation |
Write the kml object to the specified file
yourkml$writekml(path)
path |
Mandatory. The full path to your kml file. Remember that the filename must end with kml |
Brent Cameron
Department of Fisheries and Oceans Canada
Population Ecology Division
mykml = RKmlObject()
mykml$addLabelStyle(styleid = "labelstyle1", color = "red", transparency = .2, scale = 3)
mykml$addLabelStyle(styleid = "labelstyle2", color = "green", transparency = 1, scale = 1)
x = data.frame(cbind(c(45.9178, 46.807), c(-59.967, -60.321), c("labelstyle1", "labelstyle2"), c("Example1", "Example2"), c("Louisbourg", "Neil's Harbour" )))
names(x) = c("lat", "lon", "styleUrl", "name", "description")
mykml$addPoint(x)
#mykml$writekml(path = file.path(getwd(), "kml_outputs", "example_kml.kml"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.