public final class

AmazonMapOptions

extends Object
java.lang.Object
   ↳ com.amazon.geo.mapsv2.AmazonMapOptions

Class Overview

Configuration object used for setting initial map options when creating an AmazonMap. You can use this object to set options in two different ways:

When using XML attributes, include the XML namespace xmlns:map="http://schemas.android.com/apk/res-auto" in the XML file. Note that the prefix for the namespace does not have to be "map," but you must use the same prefix for each attribute.

The available XML attributes are documented with the corresponding AmazonMapOptions setter methods.

Summary

Public Constructors
AmazonMapOptions()
Creates a new, empty AmazonMapOptions object.
Public Methods
AmazonMapOptions camera(CameraPosition camera)
Sets the initial camera position.
AmazonMapOptions compassEnabled(boolean enabled)
Sets the initial setCompassEnabled(boolean) option.
static AmazonMapOptions createFromAttributes(Context context, AttributeSet attrs)
Creates an AmazonMapOptions object from layout attributes.
int describeContents()
CameraPosition getCamera()
Gets the specified CameraPosition, or null if unspecified.
Boolean getCompassEnabled()
Gets the specified compassEnabled option, or null if unspecified.
Boolean getLiteMode()
Gets the specified liteMode option, or null if unspecified.

Lite mode is not supportd in Amazon Maps API v2.5.

Boolean getMapToolbarEnabled()
Gets the specified uiMapToolbar option, or null if unspecified.
int getMapType()
Gets the specified mapType option, or -1 if unspecified.
Boolean getRotateGesturesEnabled()
Gets the specified rotateGesturesEnabled option, or null if unspecified.
Boolean getScrollGesturesEnabled()
Gets the specified scrollGesturesEnabled option, or null if unspecified.
Boolean getTiltGesturesEnabled()
Gets the specified tiltGesturesEnabled option, or null if unspecified.
Boolean getUseViewLifecycleInFragment()
Gets the specified useViewLifecycleInFragment option, or null if unspecified.

Not supported in Amazon Maps API v2.5.

Boolean getZOrderOnTop()
Gets the specified zOrderOnTop option, or null if unspecified.
Boolean getZoomControlsEnabled()
Gets the specified zoomControlsEnabled option, or null if unspecified.
Boolean getZoomGesturesEnabled()
Gets the specified zoomGesturesEnabled option, or null if unspecified.
AmazonMapOptions liteMode(boolean enabled)
Sets the initial lite mode option.

Lite mode is not supportd in Amazon Maps API v2.5.

AmazonMapOptions mapToolbarEnabled(boolean enabled)
Sets the initial setMapToolbarEnabled(boolean) option.
AmazonMapOptions mapType(int mapType)
Sets the initial setMapType(int) option.
AmazonMapOptions rotateGesturesEnabled(boolean enabled)
Sets the initial setRotateGesturesEnabled(boolean) option.
AmazonMapOptions scrollGesturesEnabled(boolean enabled)
Sets the initial setScrollGesturesEnabled(boolean) option.
AmazonMapOptions tiltGesturesEnabled(boolean enabled)
Sets the initial setTiltGesturesEnabled(boolean) option.
AmazonMapOptions useViewLifecycleInFragment(boolean useViewLifecycleInFragment)
Specifies whether the lifecycle of the map should be tied to the MapFragment's enclosing View or the MapFragment itself.

Not supported in Amazon Maps API v2.5.

void writeToParcel(Parcel out, int flags)
AmazonMapOptions zOrderOnTop(boolean zOrderOnTop)
Sets the initial zOrderOnTop setting.
AmazonMapOptions zoomControlsEnabled(boolean enabled)
Sets the initial setZoomControlsEnabled(boolean) option.
AmazonMapOptions zoomGesturesEnabled(boolean enabled)
Sets the initial setZoomGesturesEnabled(boolean) option.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public AmazonMapOptions ()

Creates a new, empty AmazonMapOptions object.

Public Methods

public AmazonMapOptions camera (CameraPosition camera)

Sets the initial camera position. Use this to set the initial camera bearing, target location (in latitude/longitude), tilt, and zoom.

To set the initial camera position in XML, use these attributes:

  • map:amzn_cameraBearing
  • map:amzn_cameraTargetLat
  • map:amzn_cameraTargetLng
  • map:amzn_cameraTilt
  • map:amzn_cameraZoom

Parameters
camera A CameraPosition object specifying the initial camera settings.
Returns
  • This AmazonMapOptions object.

public AmazonMapOptions compassEnabled (boolean enabled)

Sets the initial setCompassEnabled(boolean) option. Default is true.

When the compass is enabled, the map displays a compass icon whenever the map camera is rotated away from normal (tilt = 0 and bearing = 0). Clicking the compass icon re-orients the map to normal and causes the icon to disappear.

To set this option in XML, use the attribute map:amzn_uiCompass.

Parameters
enabled true to enable the compass UI option, or false to disable it.
Returns
  • This AmazonMapOptions object.

public static AmazonMapOptions createFromAttributes (Context context, AttributeSet attrs)

Creates an AmazonMapOptions object from layout attributes.

Parameters
context The context for the attributes.
attrs The attributes.
Returns
  • The new AmazonMapOptions object.

public int describeContents ()

public CameraPosition getCamera ()

Gets the specified CameraPosition, or null if unspecified.

public Boolean getCompassEnabled ()

Gets the specified compassEnabled option, or null if unspecified.

public Boolean getLiteMode ()

Gets the specified liteMode option, or null if unspecified.

Lite mode is not supportd in Amazon Maps API v2.5.

public Boolean getMapToolbarEnabled ()

Gets the specified uiMapToolbar option, or null if unspecified.

public int getMapType ()

Gets the specified mapType option, or -1 if unspecified.

public Boolean getRotateGesturesEnabled ()

Gets the specified rotateGesturesEnabled option, or null if unspecified.

public Boolean getScrollGesturesEnabled ()

Gets the specified scrollGesturesEnabled option, or null if unspecified.

public Boolean getTiltGesturesEnabled ()

Gets the specified tiltGesturesEnabled option, or null if unspecified.

public Boolean getUseViewLifecycleInFragment ()

Gets the specified useViewLifecycleInFragment option, or null if unspecified.

Not supported in Amazon Maps API v2.5.

public Boolean getZOrderOnTop ()

Gets the specified zOrderOnTop option, or null if unspecified.

public Boolean getZoomControlsEnabled ()

Gets the specified zoomControlsEnabled option, or null if unspecified.

public Boolean getZoomGesturesEnabled ()

Gets the specified zoomGesturesEnabled option, or null if unspecified.

public AmazonMapOptions liteMode (boolean enabled)

Sets the initial lite mode option. Default is false. Note that lite mode is not currently supported in the Amazon Maps API, so this method does nothing.

To set this option in XML, use the attribute map:amzn_liteMode.

Lite mode is not supportd in Amazon Maps API v2.5.

Parameters
enabled Lite mode is not supported, so setting this does nothing.
Returns
  • This AmazonMapOptions object.

public AmazonMapOptions mapToolbarEnabled (boolean enabled)

Sets the initial setMapToolbarEnabled(boolean) option. Default is true.

To set this option in XML, use the attribute map:amzn_uiMapToolbar.

Parameters
enabled true to enable the map toolbar, or false to disable the toolbar.
Returns
  • This AmazonMapOptions object.

public AmazonMapOptions mapType (int mapType)

Sets the initial setMapType(int) option. Default is normal.

To set this option in XML, use the attribute map:amzn_mapType. The possible XML values are:

  • amzn_none
  • amzn_normal
  • amzn_satellite
  • amzn_terrain
  • amzn_hybrid

To set this option in code, use the supported values:

Parameters
mapType The map type to initially display.
Returns
  • This AmazonMapOptions object.

public AmazonMapOptions rotateGesturesEnabled (boolean enabled)

Sets the initial setRotateGesturesEnabled(boolean) option. Default is true.

To set this option in XML, use the attribute map:amzn_uiRotateGestures.

Parameters
enabled true to enable rotate gestures, or false to disable them.
Returns
  • This AmazonMapOptions object.

public AmazonMapOptions scrollGesturesEnabled (boolean enabled)

Sets the initial setScrollGesturesEnabled(boolean) option. Default is true.

To set this option in XML, use the attribute map:amzn_uiScrollGestures.

Parameters
enabled true to enable scroll gestures, or false to disable them.
Returns
  • This AmazonMapOptions object.

public AmazonMapOptions tiltGesturesEnabled (boolean enabled)

Sets the initial setTiltGesturesEnabled(boolean) option. Default is true.

To set this option in XML, use the attribute map:amzn_uiTiltGestures.

Parameters
enabled true to enable tilt gestures, or false to disable them.
Returns
  • This AmazonMapOptions object.

public AmazonMapOptions useViewLifecycleInFragment (boolean useViewLifecycleInFragment)

Specifies whether the lifecycle of the map should be tied to the MapFragment's enclosing View or the MapFragment itself. Set to true to tie the lifecycle to the View or false to tie the lifecycle to the MapFragment. The default is false.

When set to false, the GL context is reused. This leads to better attach performance, but more memory usage while detached. Otherwise, a new GL context is created, leading to improved detached memory usage at the cost of attach performance.

When the lifecycle is tied to the view and the fragment is detached, all AmazonMap methods throw a NullPointerException.

To set this option in XML for a MapFragment or SupportMapFragment, use the attribute map:amzn_useViewLifecycle.

Not supported in Amazon Maps API v2.5.

Parameters
useViewLifecycleInFragment true to tie the lifecycle of the map to the View, or false to tie the lifecycle of the map to the MapFragment.
Returns
  • This AmazonMapOptions object.

public void writeToParcel (Parcel out, int flags)

public AmazonMapOptions zOrderOnTop (boolean zOrderOnTop)

Sets the initial zOrderOnTop setting. Default is false. Setting this to true places the map on top of the window.

To set this in the XML, use the attribute map:amzn_zOrderOnTop.

Parameters
zOrderOnTop true to enable enable the zOrderOnTop option, or false to disable it.
Returns
  • This AmazonMapOptions object.

public AmazonMapOptions zoomControlsEnabled (boolean enabled)

Sets the initial setZoomControlsEnabled(boolean) option. Default is false.

To set this option in XML, use the attribute map:amzn_uiZoomControls.

Parameters
enabled true to enable zoom controls, or false to disable them.
Returns
  • This AmazonMapOptions object.

public AmazonMapOptions zoomGesturesEnabled (boolean enabled)

Sets the initial setZoomGesturesEnabled(boolean) option. Default is {code true}.

To set this option in XML, use the attribute map:amzn_uiZoomGestures.

Parameters
enabled true to enable zoom gestures, or false to disable them.
Returns
  • This AmazonMapOptions object.