public final class

GroundOverlayOptions

extends Object
java.lang.Object
   ↳ com.amazon.geo.mapsv2.model.GroundOverlayOptions

Class Overview

Ground overlays are not currently supported in the Amazon Maps API.

Class for defining options for a new GroundOverlay.

Summary

Constants
float NO_DIMENSION For the height when it is calculated via the width and the aspect ratio of the image.
Public Constructors
GroundOverlayOptions()
Empty constructor for creating ground overlay options with all default values.
Public Methods
GroundOverlayOptions anchor(float u, float v)
Coordinates used to anchor the image at the specified position.
GroundOverlayOptions bearing(float bearing)
Sets the bearing of this ground overlay to the specified degrees clockwise from north about the anchor point normalized to [0.0, 360.0).
int describeContents()
float getAnchorU()
Gets the horizontal position of the current anchor for this ground overlay.
float getAnchorV()
Gets the vertical position of the current anchor for this ground overlay.
float getBearing()
Gets the bearing for this ground overlay.
LatLngBounds getBounds()
Gets the LatLngBounds for this ground overlay.
float getHeight()
Gets the height for this ground overlay.
BitmapDescriptor getImage()
Gets the image for this ground overlay.
LatLng getLocation()
Gets the location for this ground overlay.
float getTransparency()
Gets the transparency for this ground overlay.
float getWidth()
Gets the width for this ground overlay.
float getZIndex()
Gets the zIndex for this ground overlay.
GroundOverlayOptions image(BitmapDescriptor image)
Sets the image for this ground overlay.
boolean isVisible()
Gets the visibility of this ground overlay.
GroundOverlayOptions position(LatLng location, float width, float height)
Sets the position of this ground overlay with an anchor at a specific geographic location and a set width and height in meters.
GroundOverlayOptions position(LatLng location, float width)
Sets the position of this ground overlay with an anchor at a specific geographic location and a set width in meters.
GroundOverlayOptions positionFromBounds(LatLngBounds bounds)
Specifies the bounding box (@link LatLngBounds) that encompasses the image.
GroundOverlayOptions transparency(float transparency)
Sets the transparency for this ground overlay.
GroundOverlayOptions visible(boolean visible)
Sets the visibility for this ground overlay.
void writeToParcel(Parcel out, int flags)
GroundOverlayOptions zIndex(float zIndex)
Sets the zIndex for the ground overlay.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final float NO_DIMENSION

For the height when it is calculated via the width and the aspect ratio of the image.

Constant Value: -1.0

Public Constructors

public GroundOverlayOptions ()

Empty constructor for creating ground overlay options with all default values. Set either a position with a width (plus optional height) or the positionFromBounds(LatLngBounds) before using.

Public Methods

public GroundOverlayOptions anchor (float u, float v)

Coordinates used to anchor the image at the specified position. u and v are in the range [0.0, 1.0] where (0, 0) is the top left corner of the image and (1, 1) is the bottom right corner of the image.

Parameters
u The horizontal position to anchor the image in the range [0.0, 1.0].
v The vertical position to anchor the image in the range [0.0, 1.0].
Returns
  • This GroundOverlayOptions object.

public GroundOverlayOptions bearing (float bearing)

Sets the bearing of this ground overlay to the specified degrees clockwise from north about the anchor point normalized to [0.0, 360.0). The default is straight north (bearing = 0.0). If this bearing transform is applied to a ground overlay via positionFromBounds(LatLngBounds), the bounds will be applied first and then the rotation.

Parameters
bearing The bearing in degrees [0.0, 360.0).
Returns
  • This GroundOverlayOptions object.

public int describeContents ()

public float getAnchorU ()

Gets the horizontal position of the current anchor for this ground overlay. This is a value in the range of [0.0, 1.0].

Returns
  • The horizontal value of the anchor.

public float getAnchorV ()

Gets the vertical position of the current anchor for this ground overlay. This is a value in the range of [0.0, 1.0].

Returns
  • The vertical value of the anchor.

public float getBearing ()

Gets the bearing for this ground overlay. This is a value in the range of [0.0, 360.0).

Returns
  • The bearing.

public LatLngBounds getBounds ()

Gets the LatLngBounds for this ground overlay. This is null if the ground overlay was set via position(LatLng, float) or position(LatLng, float, float).

Returns
  • The LatLngBounds of this ground overlay.

public float getHeight ()

Gets the height for this ground overlay.

Returns
  • The height.

public BitmapDescriptor getImage ()

Gets the image for this ground overlay.

Returns
  • The image.

public LatLng getLocation ()

Gets the location for this ground overlay. This is null if the position was via positionFromBounds(LatLngBounds).

Returns
  • The LatLng at which the anchor will be set.

public float getTransparency ()

Gets the transparency for this ground overlay. The default is fully opaque, or 0.0.

Returns
  • The transparency in the range [0.0, 1.0].

public float getWidth ()

Gets the width for this ground overlay.

Returns
  • The width.

public float getZIndex ()

Gets the zIndex for this ground overlay. This defines in what order the objects are drawn on the screen. See setZIndex(float) for more details.

Returns
  • The zIndex.

public GroundOverlayOptions image (BitmapDescriptor image)

Sets the image for this ground overlay.

Parameters
image The image to be displayed.
Returns
  • This GroundOverlayOptions object.

public boolean isVisible ()

Gets the visibility of this ground overlay.

Returns
  • True if this ground overlay will start off visible.

public GroundOverlayOptions position (LatLng location, float width, float height)

Sets the position of this ground overlay with an anchor at a specific geographic location and a set width and height in meters. The image is stretched to fit the exact width and height specified. Aspect ratio is not preserved.

Parameters
location The location on the map to anchor this ground overlay. To move the anchor within the image instead of the map, use anchor(float, float).
width The width of the overlay in meters.
height The height of the overlay in meters.
Returns
  • This GroundOverlayOptions object.
Throws
IllegalArgumentException if width or height are negative.
IllegalStateException if positionFromBounds(LatLngBounds) was already called on this object.

public GroundOverlayOptions position (LatLng location, float width)

Sets the position of this ground overlay with an anchor at a specific geographic location and a set width in meters. The height is automatically calculated to preserve the aspect ratio of the image.

Parameters
location The location on the map to anchor this ground overlay. To move the anchor within the image instead of the map, use anchor(float, float).
width The width of the overlay in meters.
Returns
  • This GroundOverlayOptions object.
Throws
IllegalArgumentException if width is negative.
IllegalStateException if positionFromBounds(LatLngBounds) was already called on this object.

public GroundOverlayOptions positionFromBounds (LatLngBounds bounds)

Specifies the bounding box (@link LatLngBounds) that encompasses the image. The image is stretched to fit the LatLngBounds as well as possible, so the aspect ratio on the image is not preserved. If a bearing is set, the image is placed within the bounds first and then rotated. This may cause the image to exceed the original bounds specified.

Parameters
bounds The bounds in which to place the ground overlay
Returns
  • This GroundOverlayOptions object.

public GroundOverlayOptions transparency (float transparency)

Sets the transparency for this ground overlay. The default is fully opaque (0.0). This is a value in the range [0.0, 1.0] where 0 is opaque and 1 is transparent. Even if the ground overlay is completely transparent, isVisible() still returns true.

Parameters
transparency The transparency of the image for this ground overlay.
Returns
  • This GroundOverlayOptions object.
Throws
IllegalArgumentException if the transparency is not in the range [0.0, 1.0].

public GroundOverlayOptions visible (boolean visible)

Sets the visibility for this ground overlay. The default is true.

Parameters
visible true to make the ground overlay visible, or false to make it hidden.
Returns
  • This GroundOverlayOptions object.

public void writeToParcel (Parcel out, int flags)

public GroundOverlayOptions zIndex (float zIndex)

Sets the zIndex for the ground overlay. See setZIndex(float) for more details.

Parameters
zIndex The new zIndex. Note that this can be a non-integer value.
Returns
  • This GroundOverlayOptions object.