Description Usage Arguments Value Author(s) See Also Examples
These functions are used to create icon images for placing on Google Earth (i.e. an icon for a place mark on the earth).
1 2 3 4 | makeBallIcon(col = "red", file = "/tmp/ball.png", width = 40, height = width, radius = 0.43)
makeRectIcon(col = "red", file = "/tmp/rect.png", width = 40, height = width, radius = 1)
makePchIcon(pch = "red", col = "red", file = sprintf("pch_%s.png", as.character(pch)),
cex = 4, width = 40, height = width, radius = 1)
|
col |
a color used to control the color of the shape or character
being drawn, passed to a call to |
file |
the name of the PNG file to create |
width,height |
the width and height of the image to create, in pixels |
radius |
the size of the symbol to draw |
pch |
the plotting character to draw in the image |
cex |
character expansion factor passed on to |
a character string giving the name of the generated PNG file.
Duncan Temple Lang
kml
, kmlPoints
and the styles
parameter.
1 2 3 4 5 6 7 8 9 10 11 12 13 | makeBallIcon("red")
makePchIcon(17, "#0000FF")
mapply(makeRectIcon, heat.colors(7), sprintf("heat_%d.png", 1:7))
data(quakes)
mag = factor(as.integer(quakes$magnitude))
icons = mapply(makeBallIcon, heat.colors(length(levels(mag))), sprintf("heat_%d.png", 1:length(levels(mag))))
styles = lapply(icons, function(x) list(IconStyle = list(scale = ".5", Icon = c(href = x))))
names(styles) = gsub(".png", "", icons)
doc = kml(~ longitude + latitude, quakes, styles = styles, col = names(styles)[mag])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.