public final class

MarkerOptions

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

Class Overview

An object for defining the initial options for a Marker object. Use this to define all the properties of a Marker before calling the addMarker(MarkerOptions) method to add the Marker to the map.

Modifying MarkerOptions after the Marker has been added to the map has no effect on the appearance of the Marker.

Note that MarkerOptions methods do not need to be called on the main thread.

Summary

Public Constructors
MarkerOptions()
Creates a new MarkerOptions object with default values.
Public Methods
MarkerOptions alpha(float alpha)
Sets the alpha (opacity) to use for the new Marker.
MarkerOptions anchor(float u, float v)
Sets the anchor point to use for the new Marker's image onto the marker's position on the surface of the map.
int describeContents()
MarkerOptions draggable(boolean draggable)
Draggable markers are not supported in the Amazon Maps API.
MarkerOptions flat(boolean flat)
Flat markers are not supported in the Amazon Maps API.
float getAlpha()
Gets the alpha (opacity) to use for the new Marker.
float getAnchorU()
Gets the U coordinate to use for the new Marker's anchor measured from the left edge.
float getAnchorV()
Gets the V coordinate to use for the new Marker's anchor measured from the top edge.
BitmapDescriptor getIcon()
Gets the custom icon that was set for the new Marker.
float getInfoWindowAnchorU()
Gets the U coordinate to use for the info window's anchor, measured from the left edge.
float getInfoWindowAnchorV()
Gets the V coordinate to use for the info window's anchor, measured from the top edge.
LatLng getPosition()
Gets the position to use for the new Marker.
float getRotation()
Gets the rotation to use for the new Marker.
String getSnippet()
Gets the snippet to use for the new Marker.
String getTitle()
Gets the title to use for the new Marker.
MarkerOptions icon(BitmapDescriptor icon)
Sets a custom icon to use for the new Marker as a BitmapDescriptor.
MarkerOptions infoWindowAnchor(float u, float v)
Sets the anchor point to use for the new Marker's info window on the Marker's image.
boolean isDraggable()
Draggable markers are not supported in the Amazon Maps API.
boolean isFlat()
Flat markers are not supported in the Amazon Maps API.
boolean isVisible()
Retrieves a boolean value indicating whether the new Marker is visible or hidden.
MarkerOptions position(LatLng position)
Sets the geographic position to use for the new Marker.
MarkerOptions rotation(float rotation)
Sets the rotation to use for the new Marker measured in degrees clockwise from the default position.
MarkerOptions snippet(String snippet)
Sets the snippet text to use for the new Marker.
MarkerOptions title(String title)
Sets the title to use for the new Marker.
MarkerOptions visible(boolean visible)
Sets the visibility to use for the new Marker.
void writeToParcel(Parcel out, int flags)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public MarkerOptions ()

Creates a new MarkerOptions object with default values.

Public Methods

public MarkerOptions alpha (float alpha)

Sets the alpha (opacity) to use for the new Marker. Alpha is a value in the closed range [0, 1]. Use 0 to make the marker completely transparent, or 1 to make it completely opaque. The default is 1.

Parameters
alpha The alpha value.
Returns
  • This MarkerOptions object.

public MarkerOptions anchor (float u, float v)

Sets the anchor point to use for the new Marker's image onto the marker's position on the surface of the map. See setAnchor(float, float) for more information about anchor points. The default is the bottom middle of the image (0.5, 1).

Parameters
u The U coordinate where the image should be anchored, as a ratio to the image width and measured from the left edge. Should be in the closed range [0, 1].
v The V coordinate where the image should be anchored, as a ratio to the image height and measured from the top edge. Should be in the closed range [0, 1].
Returns
  • This MarkerOptions object.

public int describeContents ()

public MarkerOptions draggable (boolean draggable)

Draggable markers are not supported in the Amazon Maps API.

Sets the draggable property to use for the new Marker. The default is false.

Parameters
draggable true to enable dragging, false otherwise.
Returns
  • This MarkerOptions object.

public MarkerOptions flat (boolean flat)

Flat markers are not supported in the Amazon Maps API.

Sets the flat option to use for the new Marker. This determines whether the Marker is displayed as flat against the map. The default is false.

Parameters
flat Use true to make the marker flat, false otherwise.
Returns
  • This MarkerOptions object.

public float getAlpha ()

Gets the alpha (opacity) to use for the new Marker.

Returns
  • The Marker's alpha.

public float getAnchorU ()

Gets the U coordinate to use for the new Marker's anchor measured from the left edge. See setAnchor(float, float) for more information about anchor points.

Returns
  • The Marker's U coordinate.

public float getAnchorV ()

Gets the V coordinate to use for the new Marker's anchor measured from the top edge. See setAnchor(float, float) for more information about anchor points.

Returns
  • The Marker's V coordinate.

public BitmapDescriptor getIcon ()

Gets the custom icon that was set for the new Marker.

Returns
  • A BitmapDescriptor representing the custom icon, or null if no custom icon has been set.

public float getInfoWindowAnchorU ()

Gets the U coordinate to use for the info window's anchor, measured from the left edge. See setAnchor(float, float) for more information about anchor points.

Returns
  • The info window's U coordinate.

public float getInfoWindowAnchorV ()

Gets the V coordinate to use for the info window's anchor, measured from the top edge. See setAnchor(float, float) for more information about anchor points.

Returns
  • The info window's U coordinate.

public LatLng getPosition ()

Gets the position to use for the new Marker.

Returns
  • A LatLng representing the Marker position.

public float getRotation ()

Gets the rotation to use for the new Marker.

Returns
  • The rotation of the Marker in degrees clockwise from the default.

public String getSnippet ()

Gets the snippet to use for the new Marker.

Returns
  • A String containing the snippet for the Marker.

public String getTitle ()

Gets the title to use for the new Marker.

Returns
  • A String containing the title for the Marker.

public MarkerOptions icon (BitmapDescriptor icon)

Sets a custom icon to use for the new Marker as a BitmapDescriptor. Set to null to use the default icon.

Parameters
icon A custom icon, or null for the default marker.
Returns
  • This MarkerOptions object.

public MarkerOptions infoWindowAnchor (float u, float v)

Sets the anchor point to use for the new Marker's info window on the Marker's image. See setAnchor(float, float) for more information about anchor points. The default is the top middle (0.5, 0).

Parameters
u The U coordinate where the info window should be anchored, as a ratio to the image width and measured from the left edge. Should be in the closed range [0, 1].
v The V coordinate where the info window should be anchored, as a ratio to the image height and measured from the top edge. Should be in the closed range [0, 1].
Returns
  • This MarkerOptions object.

public boolean isDraggable ()

Draggable markers are not supported in the Amazon Maps API.

Retrieves a boolean value indicating whether the new Marker can be dragged.

Returns
  • true if the marker is draggable, false otherwise.

public boolean isFlat ()

Flat markers are not supported in the Amazon Maps API.

Retrieves a boolean value indicating whether the new Marker is displayed as flat or not.

Returns
  • true if the marker is flat, false otherwise.

public boolean isVisible ()

Retrieves a boolean value indicating whether the new Marker is visible or hidden.

Returns
  • true if the Marker is visible, or false if it is invisible.

public MarkerOptions position (LatLng position)

Sets the geographic position to use for the new Marker. The position must be set before adding the Marker to the map.

Parameters
position The position on the map as a LatLng. Must not be null.
Returns
  • This MarkerOptions object.

public MarkerOptions rotation (float rotation)

Sets the rotation to use for the new Marker measured in degrees clockwise from the default position. The default is zero, pointing straight up.

Parameters
rotation The rotation in degrees.
Returns
  • This MarkerOptions object.

public MarkerOptions snippet (String snippet)

Sets the snippet text to use for the new Marker. When using the default info window, the snippet text is displayed in the body of the window beneath the title.

Parameters
snippet The snippet text.
Returns
  • This MarkerOptions object.

public MarkerOptions title (String title)

Sets the title to use for the new Marker. When using the default info window, the title text displayed as the window title.

Parameters
title The title text.
Returns
  • This MarkerOptions object.

public MarkerOptions visible (boolean visible)

Sets the visibility to use for the new Marker. The default value is true.

Parameters
visible true to make the marker visible, or false to make it invisible.
Returns
  • This MarkerOptions object.

public void writeToParcel (Parcel out, int flags)