java.lang.Object | |
↳ | com.amazon.geo.mapsv2.AmazonMapOptions |
Configuration object used for setting initial map options when creating
an AmazonMap
. You can use this object to set options in two different ways:
MapFragment
, SupportMapFragment
, or
MapView
in XML, use XML attributes in the layout for the
MapFragment
, SupportMapFragment
or MapView
.
MapFragment
, SupportMapFragment
or
MapView
in code, create a AmazonMapOptions
object, set
the options you want, then pass it to the
MapView(Context, AmazonMapOptions)
,
newInstance(AmazonMapOptions)
, or
newInstance(AmazonMapOptions)
methods.
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.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new, empty
AmazonMapOptions object. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Sets the initial camera position.
| |||||||||||
Sets the initial
setCompassEnabled(boolean) option. | |||||||||||
Creates an
AmazonMapOptions object from layout attributes. | |||||||||||
Gets the specified
CameraPosition , or null if unspecified. | |||||||||||
Gets the specified
compassEnabled option, or null if unspecified. | |||||||||||
Gets the specified
liteMode option, or null if unspecified.Lite mode is not supportd in Amazon Maps API v2.5. | |||||||||||
Gets the specified
uiMapToolbar option, or null if unspecified. | |||||||||||
Gets the specified
mapType option, or -1 if unspecified. | |||||||||||
Gets the specified
rotateGesturesEnabled option, or null if unspecified. | |||||||||||
Gets the specified
scrollGesturesEnabled option, or null if unspecified. | |||||||||||
Gets the specified
tiltGesturesEnabled option, or null if unspecified. | |||||||||||
Gets the specified
useViewLifecycleInFragment option, or null if unspecified.Not supported in Amazon Maps API v2.5. | |||||||||||
Gets the specified
zOrderOnTop option, or null if unspecified. | |||||||||||
Gets the specified
zoomControlsEnabled option, or null if unspecified. | |||||||||||
Gets the specified
zoomGesturesEnabled option, or null if unspecified. | |||||||||||
Sets the initial lite mode option.
Lite mode is not supportd in Amazon Maps API v2.5. | |||||||||||
Sets the initial
setMapToolbarEnabled(boolean) option. | |||||||||||
Sets the initial
setMapType(int) option. | |||||||||||
Sets the initial
setRotateGesturesEnabled(boolean)
option. | |||||||||||
Sets the initial
setScrollGesturesEnabled(boolean)
option. | |||||||||||
Sets the initial
setTiltGesturesEnabled(boolean)
option. | |||||||||||
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. | |||||||||||
Sets the initial
zOrderOnTop setting. | |||||||||||
Sets the initial
setZoomControlsEnabled(boolean)
option. | |||||||||||
Sets the initial
setZoomGesturesEnabled(boolean)
option. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Creates a new, empty AmazonMapOptions
object.
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
camera | A CameraPosition object specifying the initial
camera settings. |
---|
AmazonMapOptions
object.
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
.
enabled | true to enable the compass UI option, or
false to disable it. |
---|
AmazonMapOptions
object.
Creates an AmazonMapOptions
object from layout attributes.
context | The context for the attributes. |
---|---|
attrs | The attributes. |
AmazonMapOptions
object.
Gets the specified compassEnabled
option, or null
if unspecified.
Gets the specified liteMode
option, or null
if unspecified.
Lite mode is not supportd in Amazon Maps API v2.5.
Gets the specified uiMapToolbar
option, or null
if unspecified.
Gets the specified mapType
option, or -1 if unspecified.
Gets the specified rotateGesturesEnabled
option, or null
if unspecified.
Gets the specified scrollGesturesEnabled
option, or null
if unspecified.
Gets the specified tiltGesturesEnabled
option, or null
if unspecified.
Gets the specified useViewLifecycleInFragment
option, or null
if unspecified.
Not supported in Amazon Maps API v2.5.
Gets the specified zoomControlsEnabled
option, or null
if unspecified.
Gets the specified zoomGesturesEnabled
option, or null
if unspecified.
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.
enabled | Lite mode is not supported, so setting this does nothing. |
---|
AmazonMapOptions
object.
Sets the initial setMapToolbarEnabled(boolean)
option.
Default is true
.
To set this option in XML, use the attribute
map:amzn_uiMapToolbar
.
enabled | true to enable the map toolbar, or false
to disable the toolbar. |
---|
AmazonMapOptions
object.
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:
mapType | The map type to initially display. |
---|
AmazonMapOptions
object.
Sets the initial setRotateGesturesEnabled(boolean)
option. Default is true
.
To set this option in XML, use the attribute
map:amzn_uiRotateGestures
.
enabled | true to enable rotate gestures, or false
to disable them. |
---|
AmazonMapOptions
object.
Sets the initial setScrollGesturesEnabled(boolean)
option. Default is true
.
To set this option in XML, use the attribute
map:amzn_uiScrollGestures
.
enabled | true to enable scroll gestures, or false
to disable them. |
---|
AmazonMapOptions
object.
Sets the initial setTiltGesturesEnabled(boolean)
option. Default is true
.
To set this option in XML, use the attribute
map:amzn_uiTiltGestures
.
enabled | true to enable tilt gestures, or false
to disable them. |
---|
AmazonMapOptions
object.
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.
useViewLifecycleInFragment | true to tie the lifecycle of the map
to the View , or false to tie the lifecycle of
the map to the MapFragment . |
---|
AmazonMapOptions
object.
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
.
zOrderOnTop | true to enable enable the zOrderOnTop option,
or false to disable it. |
---|
AmazonMapOptions
object.
Sets the initial setZoomControlsEnabled(boolean)
option. Default is false
.
To set this option in XML, use the attribute
map:amzn_uiZoomControls
.
enabled | true to enable zoom controls, or false
to disable them. |
---|
AmazonMapOptions
object.
Sets the initial setZoomGesturesEnabled(boolean)
option. Default is {code true}.
To set this option in XML, use the attribute
map:amzn_uiZoomGestures
.
enabled | true to enable zoom gestures, or false
to disable them. |
---|
AmazonMapOptions
object.