My favorites | English | Sign in

Try Google Chrome's developer tools New!

Google Earth API

KmlScreenOverlay Interface Reference

Inheritance diagram for KmlScreenOverlay:

KmlOverlay KmlFeature KmlObject GEEventEmitter

List of all members.


Public Member Functions

KmlVec2 getScreenXY ()
KmlVec2 getOverlayXY ()
KmlVec2 getRotationXY ()
KmlVec2 getSize ()
double getRotation ()
void setRotation (double rotation)

Detailed Description

Draws an image overlay fixed to the screen. Sample uses for ScreenOverlays are compasses, logos, and heads-up displays. ScreenOverlay sizing is determined by the size element. Positioning of the overlay is handled by mapping a point in the image specified by screenXY to a point on the screen specified by overlayXY. Then the image is rotated by rotation degrees about a point relative to the screen specified by rotationXY.
Note:
screenXY and overlayXY behave opposite to their corresponding behaviors in KML. This is due to a bug in the Earth API that will intentionally remain unfixed until a major version change.

Member Function Documentation

KmlVec2 KmlScreenOverlay.getScreenXY (  ) 

Specifies a point on (or outside of) the overlay image that is mapped to the screen coordinate. It requires x and y values, and the units for those values.

Note:
screenXY and overlayXY behave opposite to their corresponding behaviors in KML. This is due to a bug in the Earth API that will intentionally remain unfixed until a major version change.

KmlVec2 KmlScreenOverlay.getOverlayXY (  ) 

Specifies a point relative to the screen origin that the overlay image is mapped to. The x and y values can be specified in three different ways: as pixels ("pixels"), as fractions of the screen ("fraction"), or as inset pixels ("insetPixels"), which is an offset in pixels from the upper right corner of the screen. The x and y positions can be specified in different ways - for example, x can be in pixels and y can be a fraction. The origin of the coordinate system is in the lower left corner of the screen.

Note:
screenXY and overlayXY behave opposite to their corresponding behaviors in KML. This is due to a bug in the Earth API that will intentionally remain unfixed until a major version change.

KmlVec2 KmlScreenOverlay.getRotationXY (  ) 

Point relative to the screen about which the screen overlay is rotated.

KmlVec2 KmlScreenOverlay.getSize (  ) 

Specifies the size of the image for the screen overlay, as follows

  • A value of -1 indicates to use the native dimension
  • A value of 0 indicates to maintain the aspect ratio
  • A value of n sets the value of the dimension

double KmlScreenOverlay.getRotation (  ) 

Adjusts how the image is placed inside the field of view. This element is useful if your image has been rotated and deviates slightly from a desired horizontal view.

void KmlScreenOverlay.setRotation ( double  rotation  ) 

Adjusts how the image is placed inside the field of view. This element is useful if your image has been rotated and deviates slightly from a desired horizontal view.