Class KmlScreenOverlay


  • public final class KmlScreenOverlay
    extends KmlNode
    A KML screen overlay is an image overlay fixed to the screen. Screen overlays may be used for compasses, logos and heads-up displays.
    Since:
    100.4.0
    • Constructor Detail

      • KmlScreenOverlay

        public KmlScreenOverlay​(KmlIcon kmlIcon)
        Creates a KML screen overlay with the specified icon.
        Parameters:
        kmlIcon - the icon associated with the screen overlay
        Since:
        100.7.0
    • Method Detail

      • getColor

        public int getColor()
        Gets the color mask to be applied to the KML screen overlay's image buffer.

        Returns:
        the color mask in an integer 0xAARRGGBB format
        Since:
        100.4.0
        See Also:
        setColor(int)
      • setColor

        public void setColor​(int color)
        Sets the color mask to be applied to the KML screen overlay's image buffer.

        This is a color mask that can be used to blend the image associate with the KML screen overlay. Pixels in the overlay image are multiplied by this color channel-by-channel.

        At version 100.7, only the alpha (opacity) channel is multiplied; all others are left as-is.

        The default value is 0xFFFFFFFF (white).

        Parameters:
        color - the color mask in an integer 0xAARRGGBB format
        Since:
        100.7.0
        See Also:
        getColor()
      • getDrawOrder

        public int getDrawOrder()
        Gets the KML screen overlay's draw order.
        Returns:
        the draw order
        Since:
        100.4.0
        See Also:
        setDrawOrder(int)
      • setDrawOrder

        public void setDrawOrder​(int drawOrder)
        Sets the KML screen overlay's draw order.

        Overlays with higher draw order values are drawn on top of those with lower values.

        Parameters:
        drawOrder - the draw order
        Since:
        100.7.0
      • getIcon

        public KmlIcon getIcon()
        Gets the KML screen overlay icon.
        Returns:
        a KmlIcon
        Since:
        100.6.0
        See Also:
        setIcon(KmlIcon)
      • setIcon

        public void setIcon​(KmlIcon kmlIcon)
        Sets the KML screen overlay icon.
        Parameters:
        kmlIcon - a KmlIcon
        Since:
        100.6.0
        See Also:
        getIcon()
      • setOverlayCoordinate

        public void setOverlayCoordinate​(KmlImageCoordinate kmlImageCoordinate)
        Sets a point on (or outside of) the overlay image that is mapped to the screen coordinate returned by getScreenCoordinate(). It requires x and y values, and the units for those values.

        The overlay image coordinate's x and y values are specified by KmlImageCoordinate. It can be set in three different ways: as pixels ("pixels"), as fractions of the image ("fraction"), or as inset pixels ("insetPixels"), which is an offset in pixels from the upper right corner of the image. 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 image. If not specified, the default overlay coordinate is the center of the overlay image.

        Parameters:
        kmlImageCoordinate - a KmlImageCoordinate
        Since:
        100.7.0
        See Also:
        getOverlayCoordinate(), setScreenCoordinate(KmlImageCoordinate)
      • getRotation

        public double getRotation()
        Gets the angle of rotation of the screen overlay.

        Returns:
        the angle rotation in decimal degrees
        Since:
        100.7.0
        See Also:
        setRotation(double)
      • setRotation

        public void setRotation​(double rotation)
        Sets the angle of rotation of the screen overlay.

        The value is an angle in decimal degrees starting from north. A value of zero means no rotation, a positive number indicates clockwise rotation and a negative number indicates counterclockwise. The center of the rotation, if not specified in the rotation coordinate returned by getRotationCoordinate, is the center of the overlay image.

        Parameters:
        rotation - the angle rotation in decimal degrees
        Since:
        100.7.0
        See Also:
        getRotation(), getRotationCoordinate()
      • setScreenCoordinate

        public void setScreenCoordinate​(KmlImageCoordinate kmlImageCoordinate)
        Sets a point relative to the screen origin that the overlay image is mapped to.

        The x and y values can be set 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. If not specified, the default screen coordinate is the center of the screen.

        Parameters:
        kmlImageCoordinate - a KmlImageCoordinate
        Since:
        100.7.0
        See Also:
        getScreenCoordinate(), setOverlayCoordinate(KmlImageCoordinate)
      • setRotationCoordinate

        public void setRotationCoordinate​(KmlImageCoordinate kmlImageCoordinate)
        Sets the point relative to the screen about which the screen overlay is rotated.

        By default, the rotation point is the center of the overlay.

        Parameters:
        kmlImageCoordinate - a KmlImageCoordinate
        Since:
        100.7.0
        See Also:
        getRotationCoordinate()
      • setSize

        public void setSize​(KmlImageCoordinate kmlImageCoordinate)
        Sets the size of the image for the screen overlay.

        The size is specified by KmlImageCoordinate's x and y values. 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. By default, the size is the original size of the image.

        For example:

        • An x value of +/-1 and y value of +/-1 in KmlUnitsType.FRACTION indicates the image size equals its original x and y dimensions.
        • An x value of +/-1 and y value of 0.2 in KmlUnitsType.FRACTION indicates the image size equals its original x dimension and 20% of its y dimension.
        • An x value of 100 and y value of 500 in KmlUnitsType.PIXELS indicates the image is of size 100 pixels by 500 pixels.
        Parameters:
        kmlImageCoordinate - a KmlImageCoordinate
        Since:
        100.7.0
        See Also:
        getSize()