kmlLegend: Add a legend on a Google Earth screen

Description Usage Arguments Value Author(s) References

Description

This function allows us to place a legend on a Google Earth display. The legend can be used to identify different categories by color or line type, for example,

The legend can be a previously created image or alternatively we can use R to create a legend and display that.

Usage

1
2
3
kmlLegend(x = 0, y = 0, legend, ..., parent = NULL, name = "legend",
           units = rep("pixels", 2), dims = c(100, length(legend) * 12 * 1.5),
           filename = "legend.png", bg = "transparent")

Arguments

x,y

the screen coordinates starting at the bottom left.

legend

the name of the file containing the legend or a vector of strings giving the labels for the legend.

...

additional arguments passed on the legend if we are creating the legend within R.

parent

an XML internal node that is used as the parent for the new ScreenOverlay node being created. This can also be the KMLDoc object representing the entire KML document. In this case, the parent is taken as the Document node directly under the root node of the document.

name

a string that is displayed as the name for the ScreenOverlay node in the KML hierarchy.

units

a character vector giving the units for the x and y coordinates. The units can be "pixels", "fraction", "insetPixels".

dims

an integer vector of length 2 that is used if we create the legend in R. These give the dimensions to use when creating a PNG file for the legend giving the width and height in pixels.

filename

the name of the file to create if we are creating the legend image in R.

bg

the background to use for the call to png if we are creating the legend image in R.

Value

An XMLInternalNode whose name is GroundOverlay.

Author(s)

Duncan Temple Lang

References

http://code.google.com/apis/kml/documentation/kmlreference.html


duncantl/RKML documentation built on May 15, 2019, 5:31 p.m.