kml_screen | R Documentation |
Adds an image file (map legend or logo) as screen overlay. The same file connection is further accessible by other kml_*()
functions such as kml_layer()
and kml_close()
. This allows creation of customized multi-layered KML files.
kml_screen(image.file, sname = "", position = c("UL","ML","LL","BC","LR","MR","UR","TC")[1], overlayXY, screenXY, xyunits = c("fraction", "pixels", "insetPixels")[1], rotation = 0, size = c(0,0) )
image.file |
image file to be used for screen overlay |
sname |
screen overlay name |
position |
one of the nine standard positions |
overlayXY |
manually specified tie point on the overlay image e.g. |
screenXY |
manually specified matching tie point on the scren e.g. |
xyunits |
values of the XY units (( |
rotation |
(optional) rotation in degrees clock-wise |
size |
size correction in x and y direction |
If nothing else is specified the function looks for some of the nine typical positions: "UL"
(upper left), "ML"
(middle left), "LL"
(lower left), "BC"
(bottom centre), "LR"
(lower right), "MR"
(middle right), "UR"
(upper right), and "TC"
(top centre). The x and y values can be specified in three different ways: as pixels ("pixels"
), as fractions of the image ("fraction"
), or as inset pixels ("insetPixels"
) — an offset in pixels from the upper right corner of the image.
The function, by default, calculates with fractions. If you change the xyunits
type, all other elements need to be expressed in the same units.
Tomislav Hengl
KML Reference (https://developers.google.com/kml/documentation/?csw=1)
kml-methods
library(rgdal) library(sp) data(eberg_zones) ## Not run: # add logo in the top-center: kml_open("eberg_screen.kml") kml_layer(eberg_zones) logo = "http://meta.isric.org/images/ISRIC_right.png" kml_screen(image.file = logo, position = "TC", sname = "ISRIC logo") kml_close("eberg_screen.kml") kml_compress("eberg_screen.kml") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.