ucar.unidata.data.gis
Class KmlUtil

java.lang.Object
  extended by ucar.unidata.data.gis.KmlUtil

public class KmlUtil
extends Object

DataSource for Web Map Servers

Version:
$Revision: 1.38 $ $Date: 2007/04/16 20:34:52 $
Author:
IDV development team

Field Summary
static String ATTR_ID
          the id attribute
static String ATTR_NAME
          the name attribute
static String ATTR_X
          the x attribute
static String ATTR_XUNITS
          the xunits attribute
static String ATTR_Y
          the y attribute
static String ATTR_YUNITS
          the yunits attribute
static String TAG_ALTITUDE
           
static String TAG_ALTITUDEMODE
           
static String TAG_BALLOONSTYLE
           
static String TAG_BOTTOMFOV
           
static String TAG_CAMERA
           
static String TAG_COLOR
           
static String TAG_COLORMODE
           
static String TAG_COORDINATES
           
static String TAG_DESCRIPTION
           
static String TAG_DOCUMENT
           
static String TAG_EAST
           
static String TAG_EXTRUDE
           
static String TAG_FLYTO
          the FlyTo tag
static String TAG_FOLDER
           
static String TAG_GROUNDOVERLAY
           
static String TAG_HEADING
           
static String TAG_HREF
           
static String TAG_ICON
           
static String TAG_ICONSTYLE
           
static String TAG_KEY
           
static String TAG_KML
           
static String TAG_LABELSTYLE
           
static String TAG_LATITUDE
           
static String TAG_LATLONBOX
           
static String TAG_LEFTFOV
           
static String TAG_LINESTRING
           
static String TAG_LINESTYLE
           
static String TAG_LINK
           
static String TAG_LONGITUDE
           
static String TAG_LOOKAT
           
static String TAG_MULTIGEOMETRY
           
static String TAG_NAME
           
static String TAG_NEAR
           
static String TAG_NETWORKLINK
           
static String TAG_NORTH
           
static String TAG_OPEN
           
static String TAG_OVERLAYXY
           
static String TAG_PAIR
           
static String TAG_PHOTOOVERLAY
           
static String TAG_PLACEMARK
           
static String TAG_PLAYLIST
          the Playlist tag
static String TAG_POINT
           
static String TAG_RIGHTFOV
           
static String TAG_ROLL
           
static String TAG_ROTATION
           
static String TAG_SCALE
           
static String TAG_SCHEMA
           
static String TAG_SCREENOVERLAY
           
static String TAG_SCREENXY
           
static String TAG_SNIPPET
           
static String TAG_SOUTH
           
static String TAG_STYLE
           
static String TAG_STYLEMAP
           
static String TAG_STYLEURL
           
static String TAG_TESSELATE
           
static String TAG_TEXT
           
static String TAG_TILT
           
static String TAG_TIMESTAMP
           
static String TAG_TOPFOV
           
static String TAG_TOUR
          the Tour tag
static String TAG_URL
           
static String TAG_VIEWBOUNDSCALE
           
static String TAG_VIEWVOLUME
           
static String TAG_VISIBILITY
           
static String TAG_WAIT
          the Wait tag
static String TAG_WEST
           
static String TAG_WHEN
           
static String TAG_WIDTH
           
static String XMLNS_KML2_2
          the KML 2.2 XML namespace
 
Constructor Summary
KmlUtil()
           
 
Method Summary
static Element balloonstyle(Element parent, String text, Color bgColor)
          Create a BalloonStyle element
static Element balloonstyle(Element parent, String id, String text, Color bgColor)
          Create a BalloonStyle element wrapped in a Style element
static Element coordinates(Element parent, String coordinates)
          Make a coordinates element
static Element description(Element parent, String description)
          Make a description element (wrapped in a CDATA structure)
static Element document(Element parent, String name)
          Make a KML Document
static Element document(Element parent, String name, boolean visible)
          Make a KML Document Element
static Element folder(Element parent, String name)
          Create a Folder element
static Element folder(Element parent, String name, boolean visible)
          Create a Folder element
static Element groundOverlay(Element parent, String name, String description, String url, double north, double south, double east, double west)
          Create a GroundOverlay element
static Element iconstyle(Element parent, String url, double scale, Color color)
          Create an IconStyle element
static Element iconstyle(Element parent, String id, String url)
          Create an IconStyle element enclosed in a Style element
static Element iconstyle(Element parent, String id, String url, double scale)
          Create an IconStyle element enclosed in a Style element
static Element iconstyle(Element parent, String id, String url, double scale, Color color)
          Create an IconStyle element enclosed in a Style element
static Element kml(String name)
          Make the kml element
static Element labelstyle(Element parent, Color color, int scale)
          Create a LabelStyle element
static Element labelstyle(Element parent, String id, Color color, int scale)
          Create a LabelStyle element enclosed in a Style Element
static Element linestring(Element parent, boolean extrude, boolean tesselate, float[][] coords)
          Create a LineString element
static Element linestring(Element parent, boolean extrude, boolean tesselate, String coordinates)
          Create a LineString element
static Element linestyle(Element parent, String id, Color color, int width)
          Create a LineStyle element
static Element makeElement(Element parent, String tag)
          Make a Kml element
static Element makeText(Element parent, String tag, String text)
          Make a text node in the parent element
static Element name(Element parent, String name)
          Make a name element (wrapped in a CDATA structure)
static Element networkLink(Element parent, String name, String url)
          Make a NetworkLink element
static Element open(Element parent, boolean open)
          Set the open flag on an elemenet
static Element pair(Element parent, String key, String styleUrl)
          Make a pair element
static double[][] parseCoordinates(String coords)
          Parse coordinates
static Element placemark(Element parent, String name, String description)
          Create a Placemark
static Element placemark(Element parent, String name, String description, double lat, double lon, double alt, String styleUrl)
          Make a Placemark element
static Element placemark(Element parent, String name, String description, double lat, double lon, double alt, String[] styleUrls, boolean visible)
          Make a Placemark element
static Element placemark(Element parent, String name, String description, float[][] coords, Color color, int width)
          Make a Placemark with a Linestring
static String point(double lat, double lon, double alt, String style)
          Make a point Element string
static Element screenoverlay(Element parent, String name, String iconURL, double overlayX, double overlayY, String overlayXunits, String overlayYunits, double screenX, double screenY, String screenXunits, String screenYunits)
          Create a ScreenOverlay Element
static Element screenoverlay(Element parent, String name, String iconURL, double overlayX, double overlayY, String overlayXunits, String overlayYunits, double screenX, double screenY, String screenXunits, String screenYunits, double sizeX, double sizeY, String sizeXunits, String sizeYunits)
          Create a ScreenOverlay Element
static Element snippet(Element parent, String snippet)
          Make a snippet Element
static Element style(Element parent, String id)
          Make a Style element
static Element stylemap(Element parent, String id, String normalStyleUrl, String highlightStyleUrl)
          Create a StyleMap for normal and highlighted styles
static Element styleurl(Element parent, String url)
          Make a styleUrl element (why isn't the s capitalized?)
static Element timestamp(Element parent, Date dttm)
          Make a timestamp from the date
static String toBGRHexString(Color c)
          Convert the given color to is string BGR hex representation.
static Element visible(Element parent, boolean visible)
          Set the visibility on an Element
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TAG_ALTITUDE

public static final String TAG_ALTITUDE
See Also:
Constant Field Values

TAG_ALTITUDEMODE

public static final String TAG_ALTITUDEMODE
See Also:
Constant Field Values

TAG_BALLOONSTYLE

public static final String TAG_BALLOONSTYLE
See Also:
Constant Field Values

TAG_BOTTOMFOV

public static final String TAG_BOTTOMFOV
See Also:
Constant Field Values

TAG_CAMERA

public static final String TAG_CAMERA
See Also:
Constant Field Values

TAG_COLOR

public static final String TAG_COLOR
See Also:
Constant Field Values

TAG_COLORMODE

public static final String TAG_COLORMODE
See Also:
Constant Field Values

TAG_COORDINATES

public static final String TAG_COORDINATES
See Also:
Constant Field Values

TAG_DESCRIPTION

public static final String TAG_DESCRIPTION
See Also:
Constant Field Values

TAG_DOCUMENT

public static final String TAG_DOCUMENT
See Also:
Constant Field Values

TAG_EAST

public static final String TAG_EAST
See Also:
Constant Field Values

TAG_EXTRUDE

public static final String TAG_EXTRUDE
See Also:
Constant Field Values

TAG_FOLDER

public static final String TAG_FOLDER
See Also:
Constant Field Values

TAG_GROUNDOVERLAY

public static final String TAG_GROUNDOVERLAY
See Also:
Constant Field Values

TAG_HEADING

public static final String TAG_HEADING
See Also:
Constant Field Values

TAG_HREF

public static final String TAG_HREF
See Also:
Constant Field Values

TAG_ICON

public static final String TAG_ICON
See Also:
Constant Field Values

TAG_ICONSTYLE

public static final String TAG_ICONSTYLE
See Also:
Constant Field Values

TAG_KEY

public static final String TAG_KEY
See Also:
Constant Field Values

TAG_KML

public static final String TAG_KML
See Also:
Constant Field Values

TAG_LABELSTYLE

public static final String TAG_LABELSTYLE
See Also:
Constant Field Values

TAG_LATITUDE

public static final String TAG_LATITUDE
See Also:
Constant Field Values

TAG_LATLONBOX

public static final String TAG_LATLONBOX
See Also:
Constant Field Values

TAG_LEFTFOV

public static final String TAG_LEFTFOV
See Also:
Constant Field Values

TAG_LINESTRING

public static final String TAG_LINESTRING
See Also:
Constant Field Values

TAG_LINESTYLE

public static final String TAG_LINESTYLE
See Also:
Constant Field Values

TAG_LINK

public static final String TAG_LINK
See Also:
Constant Field Values

TAG_LONGITUDE

public static final String TAG_LONGITUDE
See Also:
Constant Field Values

TAG_LOOKAT

public static final String TAG_LOOKAT
See Also:
Constant Field Values

TAG_MULTIGEOMETRY

public static final String TAG_MULTIGEOMETRY
See Also:
Constant Field Values

TAG_NAME

public static final String TAG_NAME
See Also:
Constant Field Values

TAG_NEAR

public static final String TAG_NEAR
See Also:
Constant Field Values

TAG_NETWORKLINK

public static final String TAG_NETWORKLINK
See Also:
Constant Field Values

TAG_NORTH

public static final String TAG_NORTH
See Also:
Constant Field Values

TAG_PHOTOOVERLAY

public static final String TAG_PHOTOOVERLAY
See Also:
Constant Field Values

TAG_OPEN

public static final String TAG_OPEN
See Also:
Constant Field Values

TAG_OVERLAYXY

public static final String TAG_OVERLAYXY
See Also:
Constant Field Values

TAG_PAIR

public static final String TAG_PAIR
See Also:
Constant Field Values

TAG_PLACEMARK

public static final String TAG_PLACEMARK
See Also:
Constant Field Values

TAG_POINT

public static final String TAG_POINT
See Also:
Constant Field Values

TAG_RIGHTFOV

public static final String TAG_RIGHTFOV
See Also:
Constant Field Values

TAG_ROLL

public static final String TAG_ROLL
See Also:
Constant Field Values

TAG_ROTATION

public static final String TAG_ROTATION
See Also:
Constant Field Values

TAG_SCHEMA

public static final String TAG_SCHEMA
See Also:
Constant Field Values

TAG_SCREENOVERLAY

public static final String TAG_SCREENOVERLAY
See Also:
Constant Field Values

TAG_SCREENXY

public static final String TAG_SCREENXY
See Also:
Constant Field Values

TAG_SNIPPET

public static final String TAG_SNIPPET
See Also:
Constant Field Values

TAG_SOUTH

public static final String TAG_SOUTH
See Also:
Constant Field Values

TAG_STYLE

public static final String TAG_STYLE
See Also:
Constant Field Values

TAG_STYLEMAP

public static final String TAG_STYLEMAP
See Also:
Constant Field Values

TAG_STYLEURL

public static final String TAG_STYLEURL
See Also:
Constant Field Values

TAG_TESSELATE

public static final String TAG_TESSELATE
See Also:
Constant Field Values

TAG_TEXT

public static final String TAG_TEXT
See Also:
Constant Field Values

TAG_TILT

public static final String TAG_TILT
See Also:
Constant Field Values

TAG_TIMESTAMP

public static final String TAG_TIMESTAMP
See Also:
Constant Field Values

TAG_TOPFOV

public static final String TAG_TOPFOV
See Also:
Constant Field Values

TAG_URL

public static final String TAG_URL
See Also:
Constant Field Values

TAG_VIEWVOLUME

public static final String TAG_VIEWVOLUME
See Also:
Constant Field Values

TAG_SCALE

public static final String TAG_SCALE
See Also:
Constant Field Values

TAG_VIEWBOUNDSCALE

public static final String TAG_VIEWBOUNDSCALE
See Also:
Constant Field Values

TAG_VISIBILITY

public static final String TAG_VISIBILITY
See Also:
Constant Field Values

TAG_WEST

public static final String TAG_WEST
See Also:
Constant Field Values

TAG_WHEN

public static final String TAG_WHEN
See Also:
Constant Field Values

TAG_WIDTH

public static final String TAG_WIDTH
See Also:
Constant Field Values

TAG_TOUR

public static final String TAG_TOUR
the Tour tag

See Also:
Constant Field Values

TAG_PLAYLIST

public static final String TAG_PLAYLIST
the Playlist tag

See Also:
Constant Field Values

TAG_FLYTO

public static final String TAG_FLYTO
the FlyTo tag

See Also:
Constant Field Values

TAG_WAIT

public static final String TAG_WAIT
the Wait tag

See Also:
Constant Field Values

ATTR_ID

public static final String ATTR_ID
the id attribute

See Also:
Constant Field Values

ATTR_NAME

public static final String ATTR_NAME
the name attribute

See Also:
Constant Field Values

ATTR_X

public static final String ATTR_X
the x attribute

See Also:
Constant Field Values

ATTR_Y

public static final String ATTR_Y
the y attribute

See Also:
Constant Field Values

ATTR_XUNITS

public static final String ATTR_XUNITS
the xunits attribute

See Also:
Constant Field Values

ATTR_YUNITS

public static final String ATTR_YUNITS
the yunits attribute

See Also:
Constant Field Values

XMLNS_KML2_2

public static final String XMLNS_KML2_2
the KML 2.2 XML namespace

See Also:
Constant Field Values
Constructor Detail

KmlUtil

public KmlUtil()
Method Detail

makeElement

public static Element makeElement(Element parent,
                                  String tag)
Make a Kml element

Parameters:
parent - the parent element
tag - the tag name
Returns:
the Element

kml

public static Element kml(String name)
Make the kml element

Parameters:
name - the name of the element (not used)
Returns:
the kml element

document

public static Element document(Element parent,
                               String name)
Make a KML Document

Parameters:
parent - parent Element
name - the name of the Document
Returns:
the Document element

document

public static Element document(Element parent,
                               String name,
                               boolean visible)
Make a KML Document Element

Parameters:
parent - the parent node
name - the name of the document
visible - true if visible
Returns:
the Document element

networkLink

public static Element networkLink(Element parent,
                                  String name,
                                  String url)
Make a NetworkLink element

Parameters:
parent - parent node
name - name of the link
url - link URL
Returns:
the NetworkLink element

makeText

public static Element makeText(Element parent,
                               String tag,
                               String text)
Make a text node in the parent element

Parameters:
parent - the parent
tag - the tag
text - the text
Returns:
parent with the text element (e.g., text)

visible

public static Element visible(Element parent,
                              boolean visible)
Set the visibility on an Element

Parameters:
parent - the parent element
visible - true to be visible
Returns:
the parent

snippet

public static Element snippet(Element parent,
                              String snippet)
Make a snippet Element

Parameters:
parent - the parent
snippet - the snippet text
Returns:
the parent with the snippet

open

public static Element open(Element parent,
                           boolean open)
Set the open flag on an elemenet

Parameters:
parent - the parent node
open - true to be open
Returns:
the parent node

timestamp

public static Element timestamp(Element parent,
                                Date dttm)
Make a timestamp from the date

Parameters:
parent - the parent node
dttm - the date
Returns:
the timestamp

pair

public static Element pair(Element parent,
                           String key,
                           String styleUrl)
Make a pair element

Parameters:
parent - the parent element
key - the pair key
styleUrl - the pair styleUrl
Returns:
the Pair element

stylemap

public static Element stylemap(Element parent,
                               String id,
                               String normalStyleUrl,
                               String highlightStyleUrl)
Create a StyleMap for normal and highlighted styles

Parameters:
parent - the parent element
id - the id of the StyleMap
normalStyleUrl - the styleUrl of the normal style
highlightStyleUrl - the styleUrl of the highlighted style
Returns:
the StyleMap element

styleurl

public static Element styleurl(Element parent,
                               String url)
Make a styleUrl element (why isn't the s capitalized?)

Parameters:
parent - the parent element
url - the url
Returns:
the styleUrl element

style

public static Element style(Element parent,
                            String id)
Make a Style element

Parameters:
parent - the parent node
id - the Style id
Returns:
the Style element

iconstyle

public static Element iconstyle(Element parent,
                                String id,
                                String url)
Create an IconStyle element enclosed in a Style element

Parameters:
parent - the parent Element
id - name of the enclosing Style element
url - the icon URL
Returns:
the Style element enclosing the IconStyle element

iconstyle

public static Element iconstyle(Element parent,
                                String id,
                                String url,
                                double scale)
Create an IconStyle element enclosed in a Style element

Parameters:
parent - the parent Element
id - name of the enclosing Style element
url - the icon URL
scale - the size scale (>= 0, 1 = normal size)
Returns:
the Style element enclosing the IconStyle element

iconstyle

public static Element iconstyle(Element parent,
                                String id,
                                String url,
                                double scale,
                                Color color)
Create an IconStyle element enclosed in a Style element

Parameters:
parent - the parent Element
id - name of the enclosing Style element
url - the icon URL
scale - the size scale (>= 0, 1 = normal size)
color - the icon color
Returns:
the Style element enclosing the IconStyle element

iconstyle

public static Element iconstyle(Element parent,
                                String url,
                                double scale,
                                Color color)
Create an IconStyle element

Parameters:
parent - the parent (Style) Element
url - the icon URL
scale - the size scale (>= 0, 1 = normal size)
color - the icon color
Returns:
the IconStyle element

balloonstyle

public static Element balloonstyle(Element parent,
                                   String text,
                                   Color bgColor)
Create a BalloonStyle element

Parameters:
parent - parent (Style) element
text - the balloon text
bgColor - the background color
Returns:
the BalloonStyle element

balloonstyle

public static Element balloonstyle(Element parent,
                                   String id,
                                   String text,
                                   Color bgColor)
Create a BalloonStyle element wrapped in a Style element

Parameters:
parent - parent element
id - of the enclosing Style element
text - the balloon text
bgColor - the background color
Returns:
the Style Element with the BalloonStyle element included

labelstyle

public static Element labelstyle(Element parent,
                                 String id,
                                 Color color,
                                 int scale)
Create a LabelStyle element enclosed in a Style Element

Parameters:
parent - The parent for the style
id - the Style id
color - the label color
scale - the label size scale
Returns:
the Style Element enclosing the LabelStyle

labelstyle

public static Element labelstyle(Element parent,
                                 Color color,
                                 int scale)
Create a LabelStyle element

Parameters:
parent - The parent (Style) element
color - the label color
scale - the label size scale
Returns:
the LabelStyle

linestyle

public static Element linestyle(Element parent,
                                String id,
                                Color color,
                                int width)
Create a LineStyle element

Parameters:
parent - the parent node
id - the id for the enclosing Style
color - line color
width - line width
Returns:
the LineStyle Element

linestring

public static Element linestring(Element parent,
                                 boolean extrude,
                                 boolean tesselate,
                                 String coordinates)
Create a LineString element

Parameters:
parent - the parent node
extrude - true to extrude
tesselate - true to tesselate
coordinates - comma separated list of coordinates (lon1,lat1,alt1,lon2,lat2,alt2,....lonN,latN,altN)
Returns:
the LineString element

linestring

public static Element linestring(Element parent,
                                 boolean extrude,
                                 boolean tesselate,
                                 float[][] coords)
Create a LineString element

Parameters:
parent - the parent node
extrude - true to extrude
tesselate - true to tesselate
coords - array of coordinates (coords[lon,lat] or coords[lon,lat,alt])
Returns:
the LineString element

coordinates

public static Element coordinates(Element parent,
                                  String coordinates)
Make a coordinates element

Parameters:
parent - the parent node
coordinates - the coordinates (comma separated values)
Returns:
the coordinates element

name

public static Element name(Element parent,
                           String name)
Make a name element (wrapped in a CDATA structure)

Parameters:
parent - the parent node
name - the name text
Returns:
the name element

description

public static Element description(Element parent,
                                  String description)
Make a description element (wrapped in a CDATA structure)

Parameters:
parent - the parent node
description - the description
Returns:
the description element

folder

public static Element folder(Element parent,
                             String name)
Create a Folder element

Parameters:
parent - the parent node
name - the name of the folder
Returns:
the Folder element

folder

public static Element folder(Element parent,
                             String name,
                             boolean visible)
Create a Folder element

Parameters:
parent - the parent node
name - the name of the folder
visible - true to be visible. (all children must be not visible if you want the folder turned off)
Returns:
the Folder element

placemark

public static Element placemark(Element parent,
                                String name,
                                String description)
Create a Placemark

Parameters:
parent - the parent node
name - the name of the placemark
description - the description of the placemark
Returns:
the Placemark element

point

public static String point(double lat,
                           double lon,
                           double alt,
                           String style)
Make a point Element string

Parameters:
lat - the point latitude
lon - the point longitude
alt - the point altitude
style - the point style (not used)
Returns:
the Point text

placemark

public static Element placemark(Element parent,
                                String name,
                                String description,
                                double lat,
                                double lon,
                                double alt,
                                String styleUrl)
Make a Placemark element

Parameters:
parent - the parent node
name - the Placemark name
description - the Placemark description
lat - the latitude
lon - the latitude
alt - the latitude
styleUrl - the styleUrl
Returns:
the Placemark element

placemark

public static Element placemark(Element parent,
                                String name,
                                String description,
                                double lat,
                                double lon,
                                double alt,
                                String[] styleUrls,
                                boolean visible)
Make a Placemark element

Parameters:
parent - the parent node
name - the Placemark name
description - the Placemark description
lat - the latitude
lon - the latitude
alt - the latitude
styleUrls - the array styleUrls
visible - true for this to be showing
Returns:
the Placemark element

groundOverlay

public static Element groundOverlay(Element parent,
                                    String name,
                                    String description,
                                    String url,
                                    double north,
                                    double south,
                                    double east,
                                    double west)
Create a GroundOverlay element

Parameters:
parent - the parent node
name - the name of the GroundOverlay
description - the description of the GroundOverlay
url - the URL of the overlay
north - the north coordinate
south - the south coordinate
east - the east coordinate
west - the west coordinate
Returns:
the GroundOverlay

placemark

public static Element placemark(Element parent,
                                String name,
                                String description,
                                float[][] coords,
                                Color color,
                                int width)
Make a Placemark with a Linestring

Parameters:
parent - the parent node
name - the name of the Placemark
description - the description of the Placemark
coords - the line coordinates
color - the line color
width - the line width
Returns:
the Placemark

parseCoordinates

public static double[][] parseCoordinates(String coords)
Parse coordinates

Parameters:
coords - the string of space separated coordinates
Returns:
the parsed coordinates

toBGRHexString

public static String toBGRHexString(Color c)
Convert the given color to is string BGR hex representation. KML uses ABGR instead of RGBA

Parameters:
c - color
Returns:
hex representation (BGR) of the Color's r,g,b values

screenoverlay

public static Element screenoverlay(Element parent,
                                    String name,
                                    String iconURL,
                                    double overlayX,
                                    double overlayY,
                                    String overlayXunits,
                                    String overlayYunits,
                                    double screenX,
                                    double screenY,
                                    String screenXunits,
                                    String screenYunits)
Create a ScreenOverlay Element

Parameters:
parent - parent Element
name - the name of the element
iconURL - the URL of the icon
overlayX - x component of a point on the overlay image
overlayY - y component of a point on the overlay image
overlayXunits - units of overlayX, can be one of: fraction, pixels, or insetPixels
overlayYunits - units of overlayY, can be one of: fraction, pixels, or insetPixels
screenX - x component of a point on the screen
screenY - y component of a point on the screen
screenXunits - units of screenX, can be one of: fraction, pixels, or insetPixels
screenYunits - units of screenY, can be one of: fraction, pixels, or insetPixels
Returns:
the ScreenOverlay Element

screenoverlay

public static Element screenoverlay(Element parent,
                                    String name,
                                    String iconURL,
                                    double overlayX,
                                    double overlayY,
                                    String overlayXunits,
                                    String overlayYunits,
                                    double screenX,
                                    double screenY,
                                    String screenXunits,
                                    String screenYunits,
                                    double sizeX,
                                    double sizeY,
                                    String sizeXunits,
                                    String sizeYunits)
Create a ScreenOverlay Element

Parameters:
parent - parent Element
name - the name of the element
iconURL - the URL of the icon
overlayX - x component of a point on the overlay image
overlayY - y component of a point on the overlay image
overlayXunits - units of overlayX, can be one of: fraction, pixels, or insetPixels
overlayYunits - units of overlayY, can be one of: fraction, pixels, or insetPixels
screenX - x component of a point on the screen
screenY - y component of a point on the screen
screenXunits - units of screenX, can be one of: fraction, pixels, or insetPixels
screenYunits - units of screenY, can be one of: fraction, pixels, or insetPixels
sizeX - the x size of the image for the screen overlay, as follows: 1 indicates to use the native dimension, 0 indicates to maintain the aspect ratio, a value of n sets the value of the dimension
sizeY - the y size of the image for the screen overlay (see sizeX)
sizeXunits - units of sizeX, fraction or pixels
sizeYunits - units of sizeY, fraction or pixels
Returns:
the ScreenOverlay Element