MarkerOptions

Builder class for creating Marker instances with a fluent API. A builder for marker configuration.

Example usage:

val marker = MarkerOptions()
.position(LatLng(51.4818, 0.0))
.title("Greenwich Observatory")
.snippet("Prime Meridian")
.draggable(true)
.alpha(0.8f)

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard

Sets the opacity of the marker.

Link copied to clipboard
fun anchor(anchorU: Float, anchorV: Float): MarkerOptions

Sets the anchor point for the marker icon.

Link copied to clipboard

Sets whether the marker can be dragged.

Link copied to clipboard

Sets whether the icon lies flat on the map and turns with it when the camera has a bearing, instead of facing the screen.

Link copied to clipboard

Sets a custom icon for the marker.

Link copied to clipboard
fun infoWindowAnchor(anchorU: Float, anchorV: Float): MarkerOptions

Sets the point of the icon the info window points at.

Link copied to clipboard
fun position(position: LatLng): MarkerOptions

Sets the position of the marker.

Link copied to clipboard
fun rotation(rotation: Float): MarkerOptions

Sets the clockwise rotation of the icon around its anchor, e.g. a vehicle's heading.

Link copied to clipboard
fun snippet(snippet: String?): MarkerOptions

Sets the snippet text for the marker's info window.

Link copied to clipboard
fun tag(tag: Any?): MarkerOptions

Sets optional user data associated with the marker.

Link copied to clipboard
fun title(title: String?): MarkerOptions

Sets the title text for the marker's info window.

Link copied to clipboard

Sets whether the marker is visible.

Link copied to clipboard
fun zIndex(zIndex: Float): MarkerOptions

Sets the z-index for draw order.