implements SafeParcelable
Defines configuration GoogleMapOptions for a GoogleMap
. These options can be used when
adding a map to your application programmatically (as opposed to via XML). If you are using a
MapFragment
, you can pass these options in using the static factory method
newInstance(GoogleMapOptions)
. If you are using a MapView
, you can
pass these options in using the constructor MapView(Context, GoogleMapOptions)
.
If you add a map using XML, then you can apply these options using custom XML tags.
Inherited Constant Summary
Public Constructor Summary
GoogleMapOptions()
Creates a new GoogleMapOptions object.
|
Public Method Summary
GoogleMapOptions |
ambientEnabled(boolean enabled)
Specifies whether ambient-mode styling should be enabled.
|
GoogleMapOptions | |
GoogleMapOptions |
compassEnabled(boolean enabled)
Specifies whether the compass should be enabled.
|
static GoogleMapOptions |
createFromAttributes(Context context, AttributeSet attrs)
Creates a GoogleMapsOptions from the attribute set
|
Boolean | |
CameraPosition | |
Boolean | |
Boolean | |
Boolean | |
int | |
Boolean | |
Boolean | |
Boolean | |
Boolean | |
Boolean | |
Boolean | |
Boolean | |
GoogleMapOptions |
liteMode(boolean enabled)
Specifies whether the map should be created in lite mode.
|
GoogleMapOptions |
mapToolbarEnabled(boolean enabled)
Specifies whether the mapToolbar should be enabled.
|
GoogleMapOptions |
mapType(int mapType)
Specifies a change to the initial map type.
|
GoogleMapOptions |
rotateGesturesEnabled(boolean enabled)
Specifies whether rotate gestures should be enabled.
|
GoogleMapOptions |
scrollGesturesEnabled(boolean enabled)
Specifies whether scroll gestures should be enabled.
|
GoogleMapOptions |
tiltGesturesEnabled(boolean enabled)
Specifies whether tilt gestures should be enabled.
|
GoogleMapOptions |
useViewLifecycleInFragment(boolean useViewLifecycleInFragment)
When using a
MapFragment , this flag specifies whether the lifecycle of the map
should be tied to the fragment's view or the fragment itself. |
void |
writeToParcel(Parcel out, int flags)
|
GoogleMapOptions |
zOrderOnTop(boolean zOrderOnTop)
Control whether the map view's surface is placed on top of its window.
|
GoogleMapOptions |
zoomControlsEnabled(boolean enabled)
Specifies whether the zoom controls should be enabled.
|
GoogleMapOptions |
zoomGesturesEnabled(boolean enabled)
Specifies whether zoom gestures should be enabled.
|
Inherited Method Summary
Public Constructors
public GoogleMapOptions ()
Creates a new GoogleMapOptions object.
Public Methods
public GoogleMapOptions ambientEnabled (boolean enabled)
Specifies whether ambient-mode styling should be enabled. The default value is
false
. When enabled, ambient-styled maps can be displayed when an Ambiactive
device enters ambient mode.
public GoogleMapOptions camera (CameraPosition camera)
Specifies a the initial camera position for the map.
public GoogleMapOptions compassEnabled (boolean enabled)
Specifies whether the compass should be enabled. See
setCompassEnabled(boolean)
for more details. The default value is
true
.
public static GoogleMapOptions createFromAttributes (Context context, AttributeSet attrs)
Creates a GoogleMapsOptions from the attribute set
public Boolean getMapToolbarEnabled ()
Returns
- the mapToolbarEnabled option, or null if unspecified.
public int getMapType ()
Returns
- the mapType option, or -1 if unspecified.
public Boolean getRotateGesturesEnabled ()
Returns
- the rotateGesturesEnabled option, or null if unspecified.
public Boolean getScrollGesturesEnabled ()
Returns
- the scrollGesturesEnabled option, or null if unspecified.
public Boolean getTiltGesturesEnabled ()
Returns
- the tiltGesturesEnabled option, or null if unspecified.
public Boolean getUseViewLifecycleInFragment ()
Returns
- the useViewLifecycleInFragment option, or null if unspecified.
public Boolean getZoomControlsEnabled ()
Returns
- the zoomControlsEnabled option, or null if unspecified.
public Boolean getZoomGesturesEnabled ()
Returns
- the zoomGesturesEnabled option, or null if unspecified.
public GoogleMapOptions liteMode (boolean enabled)
Specifies whether the map should be created in lite mode. The default value is
false
. If lite mode is enabled, maps will load as static images. This improves
performance in the case where a lot of maps need to be displayed at the same time, for
example in a scrolling list, however lite-mode maps cannot be panned or zoomed by the user,
or tilted or rotated at all.
public GoogleMapOptions mapToolbarEnabled (boolean enabled)
Specifies whether the mapToolbar should be enabled. See
setMapToolbarEnabled(boolean)
for more details. The default value
is true
.
public GoogleMapOptions rotateGesturesEnabled (boolean enabled)
Specifies whether rotate gestures should be enabled. See
setRotateGesturesEnabled(boolean)
for more details. The default value
is true
.
public GoogleMapOptions scrollGesturesEnabled (boolean enabled)
Specifies whether scroll gestures should be enabled. See
setScrollGesturesEnabled(boolean)
for more details. The default value
is true
.
public GoogleMapOptions tiltGesturesEnabled (boolean enabled)
Specifies whether tilt gestures should be enabled. See
setTiltGesturesEnabled(boolean)
for more details. The default value is
true
.
public GoogleMapOptions useViewLifecycleInFragment (boolean useViewLifecycleInFragment)
When using a MapFragment
, this flag specifies whether the lifecycle of the map
should be tied to the fragment's view or the fragment itself. The default value is
false
, tying the lifecycle of the map to the fragment.
Using the lifecycle of the fragment allows faster rendering of the map when the fragment is detached and reattached, because the underlying GL context is preserved. This has the cost that detaching the fragment, but not destroying it, will not release memory used by the map.
Using the lifecycle of a fragment's view means that a map is not reused when the fragment
is detached and reattached. This will cause the map to re-render from scratch, which can
take a few seconds. It also means that while a fragment is detached, and therefore has no
view, all GoogleMap
methods will throw NullPointerException
.
public GoogleMapOptions zOrderOnTop (boolean zOrderOnTop)
Control whether the map view's surface is placed on top of its window. See
setZOrderOnTop(boolean)
for more details. Note that this
will cover all other views that could appear on the map (e.g., the zoom controls, the my
location button).
public GoogleMapOptions zoomControlsEnabled (boolean enabled)
Specifies whether the zoom controls should be enabled. See
setZoomControlsEnabled(boolean)
for more details. The default value is
true
.
public GoogleMapOptions zoomGesturesEnabled (boolean enabled)
Specifies whether zoom gestures should be enabled. See
setZoomGesturesEnabled(boolean)
for more details. The default value is
true
.