PlaceMarker


@CarProtocol
public final class PlaceMarker


Describes how a place is to be displayed on a map.

Summary

Nested types

public final class PlaceMarker.Builder

A builder of PlaceMarker.

Constants

static final int

Represents a marker icon.

static final int

Represents a marker image.

Public methods

boolean
@Nullable CarColor

Returns the marker color or null if not set.

@Nullable CarIcon

Returns the CarIcon associated with this marker or null if not set.

int

Returns the type of icon used with this marker.

@Nullable CarText

Returns the text that should be rendered as the marker's content or null if one is not set.

int
@NonNull String

Constants

TYPE_ICON

Added in 1.0.0
public static final int TYPE_ICON = 0

Represents a marker icon.

To minimize scaling artifacts across a wide range of car screens, apps should provide images targeting a 64 x 64 dp bounding box. If necessary, the icon will be scaled down while preserving its aspect ratio.

A tint color is expected to be provided via setTint. Otherwise, a default tint color as determined by the host will be applied.

TYPE_IMAGE

Added in 1.0.0
public static final int TYPE_IMAGE = 1

Represents a marker image.

To minimize scaling artifacts across a wide range of car screens, apps should provide images targeting a 72 x 72 dp bounding box. If necessary, the image will be scaled down while preserving its aspect ratio.

Public methods

equals

public boolean equals(@Nullable Object other)

getColor

Added in 1.0.0
public @Nullable CarColor getColor()

Returns the marker color or null if not set.

See setColor on rules related to how the color is applied.

getIcon

Added in 1.0.0
public @Nullable CarIcon getIcon()

Returns the CarIcon associated with this marker or null if not set.

getIconType

Added in 1.0.0
public int getIconType()

Returns the type of icon used with this marker.

getLabel

Added in 1.0.0
public @Nullable CarText getLabel()

Returns the text that should be rendered as the marker's content or null if one is not set.

Note that a PlaceMarker can only display either an icon or a text label. If both are set, then getIcon will take precedence.

hashCode

public int hashCode()

toString

public @NonNull String toString()