java.lang.Object |
↳ |
com.google.android.gms.maps.GoogleMapOptions |
Class Overview
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.
Summary
[Expand]
Inherited Constants |
From interface
android.os.Parcelable
int |
CONTENTS_FILE_DESCRIPTOR |
|
int |
PARCELABLE_WRITE_RETURN_VALUE |
|
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
From interface
android.os.Parcelable
abstract
int
|
describeContents()
|
abstract
void
|
writeToParcel(Parcel arg0, int arg1)
|
|
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.
Parameters |
enabled |
boolean |
Specifies a the initial camera position for the map.
Parameters |
camera |
CameraPosition |
public
static
GoogleMapOptions
createFromAttributes
(Context context, AttributeSet attrs)
Creates a GoogleMapsOptions from the AttributeSet
.
Parameters |
context |
Context |
attrs |
AttributeSet |
public
Boolean
getAmbientEnabled
()
Returns |
Boolean |
the ambientEnabled option, or null if unspecified. |
public
Boolean
getCompassEnabled
()
Returns |
Boolean |
the compassEnabled option, or null if unspecified. |
public
LatLngBounds
getLatLngBoundsForCameraTarget
()
Returns |
LatLngBounds |
the LatLngBounds used to constrain the camera target, or null if unspecified. |
public
Boolean
getLiteMode
()
Returns |
Boolean |
the liteMode option, or null if unspecified. |
public
Boolean
getMapToolbarEnabled
()
Returns |
Boolean |
the mapToolbarEnabled option, or null if unspecified. |
public
int
getMapType
()
Returns |
int |
the mapType option, or -1 if unspecified. |
public
Float
getMaxZoomPreference
()
Returns |
Float |
the maximum zoom level preference, or null if unspecified. |
public
Float
getMinZoomPreference
()
Returns |
Float |
the minimum zoom level preference, or null if unspecified. |
public
Boolean
getRotateGesturesEnabled
()
Returns |
Boolean |
the rotateGesturesEnabled option, or null if unspecified. |
public
Boolean
getScrollGesturesEnabled
()
Returns |
Boolean |
the scrollGesturesEnabled option, or null if unspecified. |
public
Boolean
getTiltGesturesEnabled
()
Returns |
Boolean |
the tiltGesturesEnabled option, or null if unspecified. |
public
Boolean
getUseViewLifecycleInFragment
()
Returns |
Boolean |
the useViewLifecycleInFragment option, or null if unspecified. |
public
Boolean
getZOrderOnTop
()
Returns |
Boolean |
the zOrderOnTop option, or null if unspecified. |
public
Boolean
getZoomControlsEnabled
()
Returns |
Boolean |
the zoomControlsEnabled option, or null if unspecified. |
public
Boolean
getZoomGesturesEnabled
()
Returns |
Boolean |
the zoomGesturesEnabled option, or null if unspecified. |
Specifies a LatLngBounds to constrain the camera target, so that when users scroll and pan the
map, the camera target does not move outside these bounds.
See setLatLngBoundsForCameraTarget(LatLngBounds)
for details.
Parameters |
llbounds |
LatLngBounds |
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.
Parameters |
enabled |
boolean |
Specifies a change to the initial map type.
public
String
toString
()
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
.
Parameters |
useViewLifecycleInFragment |
boolean |
public
void
writeToParcel
(Parcel out, int flags)
Parameters |
out |
Parcel |
flags |
int |
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).
Parameters |
zOrderOnTop |
boolean |