java.lang.Object | |
↳ | com.google.android.gms.maps.model.MarkerOptions |
Defines MarkerOptions for a marker.
For more information, read the Markers developer guide.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new set of marker options.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Sets the alpha (opacity) of the marker.
| |||||||||||
Specifies the anchor to be at a particular point in the marker image.
| |||||||||||
Sets the draggability for the marker.
| |||||||||||
Sets whether this marker should be flat against the map
true or a billboard facing
the camera false . | |||||||||||
Gets the alpha set for this
MarkerOptions object. | |||||||||||
Horizontal distance, normalized to [0, 1], of the anchor from the left edge.
| |||||||||||
Vertical distance, normalized to [0, 1], of the anchor from the top edge.
| |||||||||||
Gets the custom icon descriptor set for this
MarkerOptions object. | |||||||||||
Horizontal distance, normalized to [0, 1], of the info window anchor from the left edge.
| |||||||||||
Vertical distance, normalized to [0, 1], of the info window anchor from the top edge.
| |||||||||||
Returns the position set for this
MarkerOptions object. | |||||||||||
Gets the rotation set for this
MarkerOptions object. | |||||||||||
Gets the snippet set for this
MarkerOptions object. | |||||||||||
Gets the title set for this
MarkerOptions object. | |||||||||||
Gets the zIndex set for this
MarkerOptions object. | |||||||||||
Sets the icon for the marker.
| |||||||||||
Specifies the anchor point of the info window on the marker image.
| |||||||||||
Gets the draggability setting for this
MarkerOptions object. | |||||||||||
Gets the flat setting for this
MarkerOptions object. | |||||||||||
Gets the visibility setting for this
MarkerOptions object. | |||||||||||
Sets the location for the marker.
| |||||||||||
Sets the rotation of the marker in degrees clockwise about the marker's anchor point.
| |||||||||||
Sets the snippet for the marker.
| |||||||||||
Sets the title for the marker.
| |||||||||||
Sets the visibility for the marker.
| |||||||||||
Sets the zIndex for the marker.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Creates a new set of marker options.
Sets the alpha (opacity) of the marker. This is a value from 0 to 1, where 0 means the marker is completely transparent and 1 means the marker is completely opaque.
Parameters | |
---|---|
alpha |
float
|
Returns | |
---|---|
MarkerOptions |
the object for which the method was called, with the new alpha set. |
Specifies the anchor to be at a particular point in the marker image.
The anchor specifies the point in the icon image that is anchored to the marker's position on the Earth's surface.
The anchor point is specified in the continuous space [0.0, 1.0] x [0.0, 1.0], where (0, 0) is the top-left corner of the image, and (1, 1) is the bottom-right corner. The anchoring point in a W x H image is the nearest discrete grid point in a (W + 1) x (H + 1) grid, obtained by scaling the then rounding. For example, in a 4 x 2 image, the anchor point (0.7, 0.6) resolves to the grid point at (3, 1).
*-----+-----+-----+-----* | | | | | | | | | | +-----+-----+-----+-----+ | | | X | | (U, V) = (0.7, 0.6) | | | | | *-----+-----+-----+-----* *-----+-----+-----+-----* | | | | | | | | | | +-----+-----+-----X-----+ (X, Y) = (3, 1) | | | | | | | | | | *-----+-----+-----+-----*
Parameters | |
---|---|
u |
float :
u-coordinate of the anchor, as a ratio of the image width (in the range [0, 1]) |
v |
float :
v-coordinate of the anchor, as a ratio of the image height (in the range [0, 1]) |
Returns | |
---|---|
MarkerOptions |
the object for which the method was called, with the new anchor set. |
Sets the draggability for the marker.
Parameters | |
---|---|
draggable |
boolean
|
Returns | |
---|---|
MarkerOptions |
the object for which the method was called, with the new draggable state set. |
Sets whether this marker should be flat against the map true
or a billboard facing
the camera false
. If the marker is flat against the map, it will remain stuck to the
map as the camera rotates and tilts but will still remain the same size as the camera zooms,
unlike a GroundOverlay
. If the marker is a billboard, it will always be drawn facing
the camera and will rotate and tilt with the camera. The default value is false
.
Parameters | |
---|---|
flat |
boolean
|
Returns | |
---|---|
MarkerOptions |
the object for which the method was called, with the new flat state set. |
Gets the alpha set for this MarkerOptions
object.
Returns | |
---|---|
float |
the alpha of the marker in the range [0, 1]. |
Horizontal distance, normalized to [0, 1], of the anchor from the left edge.
Returns | |
---|---|
float |
the u value of the anchor. |
Vertical distance, normalized to [0, 1], of the anchor from the top edge.
Returns | |
---|---|
float |
the v value of the anchor. |
Gets the custom icon descriptor set for this MarkerOptions
object.
Returns | |
---|---|
BitmapDescriptor |
A BitmapDescriptor representing the custom icon, or null if no
custom icon is set.
|
Horizontal distance, normalized to [0, 1], of the info window anchor from the left edge.
Returns | |
---|---|
float |
the u value of the info window anchor. |
Vertical distance, normalized to [0, 1], of the info window anchor from the top edge.
Returns | |
---|---|
float |
the v value of the info window anchor. |
Returns the position set for this MarkerOptions
object.
Returns | |
---|---|
LatLng |
A LatLng object specifying the marker's current position.
|
Gets the rotation set for this MarkerOptions
object.
Returns | |
---|---|
float |
the rotation of the marker in degrees clockwise from the default position. |
Gets the snippet set for this MarkerOptions
object.
Returns | |
---|---|
String |
A string containing the marker's snippet. |
Gets the title set for this MarkerOptions
object.
Returns | |
---|---|
String |
A string containing the marker's title. |
Gets the zIndex set for this MarkerOptions
object.
Returns | |
---|---|
float |
the zIndex of the marker. |
Sets the icon for the marker.
Parameters | |
---|---|
iconDescriptor |
BitmapDescriptor :
if null , the default marker is used. |
Returns | |
---|---|
MarkerOptions |
the object for which the method was called, with the new icon descriptor set. |
Specifies the anchor point of the info window on the marker image. This is specified in the
same coordinate system as the anchor. See anchor(float, float)
for more details.
The default is the top middle of the image.
Parameters | |
---|---|
u |
float :
u-coordinate of the info window anchor, as a ratio of the image width (in the range
[0, 1]) |
v |
float :
v-coordinate of the info window anchor, as a ratio of the image height (in the range
[0, 1]) |
Returns | |
---|---|
MarkerOptions |
the object for which the method was called, with the new info window anchor set. |
Gets the draggability setting for this MarkerOptions
object.
Returns | |
---|---|
boolean |
true if the marker is draggable; otherwise, returns false .
|
Gets the flat setting for this MarkerOptions
object.
Returns | |
---|---|
boolean |
true if the marker is flat against the map; false if the marker
should face the camera.
|
Gets the visibility setting for this MarkerOptions
object.
Returns | |
---|---|
boolean |
true if the marker is visible; otherwise, returns false .
|
Sets the location for the marker.
Parameters | |
---|---|
latlng |
LatLng
|
Returns | |
---|---|
MarkerOptions |
the object for which the method was called, with the new position set. |
Sets the rotation of the marker in degrees clockwise about the marker's anchor point. The axis of rotation is perpendicular to the marker. A rotation of 0 corresponds to the default position of the marker. When the marker is flat on the map, the default position is North aligned and the rotation is such that the marker always remains flat on the map. When the marker is a billboard, the default position is pointing up and the rotation is such that the marker is always facing the camera. The default value is 0.
Parameters | |
---|---|
rotation |
float
|
Returns | |
---|---|
MarkerOptions |
the object for which the method was called, with the new rotation set. |
Sets the snippet for the marker.
Parameters | |
---|---|
snippet |
String
|
Returns | |
---|---|
MarkerOptions |
the object for which the method was called, with the new snippet set. |
Sets the title for the marker.
Parameters | |
---|---|
title |
String
|
Returns | |
---|---|
MarkerOptions |
the object for which the method was called, with the new title set. |
Sets the visibility for the marker.
Parameters | |
---|---|
visible |
boolean
|
Returns | |
---|---|
MarkerOptions |
the object for which the method was called, with the new visibility state set. |
Parameters | |
---|---|
out |
Parcel
|
flags |
int
|
Sets the zIndex for the marker.
Parameters | |
---|---|
zIndex |
float
|
Returns | |
---|---|
MarkerOptions |
the object for which the method was called, with the new zIndex set. |