Defines marker options forAdvancedMarker
.
Nested Class Summary
@interface | AdvancedMarkerOptions.CollisionBehavior | Indicates how the marker is dealt with when involved in a collision with other markers or base map labels. |
Inherited Constant Summary
Public Constructor Summary
Public Method Summary
AdvancedMarkerOptions |
Alpha(float Alpha )
Sets the Alpha (opacity) of the marker.
|
AdvancedMarkerOptions |
anchor(float u, float v)
Specifies the anchor to be at a particular point in the marker image.
|
AdvancedMarkerOptions |
collisionBehavior(int collisionBehavior)
Sets the
AdvancedMarkerOptions.CollisionBehavior of the marker.
|
AdvancedMarkerOptions | |
AdvancedMarkerOptions |
draggable(boolean draggable)
Sets the draggability for the marker.
|
AdvancedMarkerOptions |
flat(boolean flat)
Sets whether this marker should be flat against the map
true or a
billboard facing the camerafalse .
|
int |
getCollisionBehavior()
Gets the
AdvancedMarkerOptions.CollisionBehavior for this
AdvancedMarkerOptions object.
|
View |
getIconView()
Gets the icon view instance for this
AdvancedMarkerOptions object.
|
AdvancedMarkerOptions | |
AdvancedMarkerOptions | |
AdvancedMarkerOptions |
infoWindowAnchor(float u, float v)
Specifies the anchor point of the info window on the marker image.
|
AdvancedMarkerOptions | |
AdvancedMarkerOptions |
rotation(float rotation)
Sets the rotation of the marker in degrees clockwise about the marker's anchor
point.
|
AdvancedMarkerOptions | |
AdvancedMarkerOptions | |
AdvancedMarkerOptions |
visible(boolean visible)
Sets the visibility for the marker.
|
AdvancedMarkerOptions |
zIndex(float zIndex)
Sets the zIndex for the marker.
|
Inherited Method Summary
Public Constructors
publicAdvancedMarkerOptions()
Public Methods
publicAdvancedMarkerOptions Alpha(float Alpha )
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.
Returns
- the object for which the method was called, with the new Alpha set.
publicAdvancedMarkerOptions anchor(float u, float v)
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 aWxHimage 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 | u-coordinate of the anchor, as a ratio of the image width (in the range [0, 1]) |
---|---|
v | v-coordinate of the anchor, as a ratio of the image height (in the range [0, 1]) |
Returns
- the object for which the method was called, with the new anchor set.
publicAdvancedMarkerOptions collisionBehavior(int collisionBehavior)
Sets the
AdvancedMarkerOptions.CollisionBehavior
of the marker.
publicAdvancedMarkerOptions contentDescription(String contentDescription)
Sets the content description on the marker.
Returns
- the object for which the method was called, with the content description set.
publicAdvancedMarkerOptions draggable(boolean draggable)
Sets the draggability for the marker.
Returns
- the object for which the method was called, with the new draggable state set.
publicAdvancedMarkerOptions flat(boolean flat)
Sets whether this marker should be flat against the maptrue
or a
billboard facing the camerafalse
.If the marker is flat against the map,
it will always be drawn facing the camera and will rotate and tilt with the camera,
unlike aGroundOverlay
.
If the marker is a billboard, it will remain stuck to the map as the camera rotates and
tilts. Both flat and billboard markers remain the same size as the camera zooms. The
default value isfalse
.
Returns
- the object for which the method was called, with the new flat state set.
public intgetCollisionBehavior()
Gets the
AdvancedMarkerOptions.CollisionBehavior
for thisAdvancedMarkerOptions
object.
Returns
- the collision behavior.
publicViewgetIconView()
Gets the icon view instance for thisAdvancedMarkerOptions
object.
Returns
- the icon view instance.
publicAdvancedMarkerOptions icon(BitmapDescriptor iconDescriptor)
Sets the icon for the marker.
Parameters
iconDescriptor | ifnull ,the default marker is used. |
---|
Returns
- the object for which the method was called, with the new icon descriptor set.
publicAdvancedMarkerOptions iconView(Viewview)
Sets the view instance to be used as icon for the marker.
If iconView is set, theBitmapDescriptor
set via
icon(BitmapDescriptor)
will be ignored.
Parameters
view | the View to be used as marker icon. |
---|
publicAdvancedMarkerOptions infoWindowAnchor(float u, float v)
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 | u-coordinate of the info window anchor, as a ratio of the image width (in the range [0, 1]) |
---|---|
v | v-coordinate of the info window anchor, as a ratio of the image height (in the range [0, 1]) |
Returns
- the object for which the method was called, with the new info window anchor set.
publicAdvancedMarkerOptions position(LatLng latlng)
Sets the location for the marker.
Returns
- the object for which the method was called, with the new position set.
publicAdvancedMarkerOptions rotation(float rotation)
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.
Returns
- the object for which the method was called, with the new rotation set.
publicAdvancedMarkerOptions snippet(Stringsnippet)
Sets the snippet for the marker.
Returns
- the object for which the method was called, with the new snippet set.
publicAdvancedMarkerOptions title(Stringtitle)
Sets the title for the marker.
Returns
- the object for which the method was called, with the new title set.
publicAdvancedMarkerOptions visible(boolean visible)
Sets the visibility for the marker.
Returns
- the object for which the method was called, with the new visibility state set.
publicAdvancedMarkerOptions zIndex(float zIndex)
Sets the zIndex for the marker.
Returns
- the object for which the method was called, with the new zIndex set.