AdvancedMarkerOptions.CollisionBehavior
Stay organized with collections
Save and categorize content based on your preferences.
Indicates how the marker is dealt with when involved in a collision with other markers or
base map labels.
Constant Summary
int |
OPTIONAL_AND_HIDES_LOWER_PRIORITY
|
Set if the marker may be replaced/overlapped by
a required marker or replaced by an OPTIONAL_AND_HIDES_LOWER_PRIORITY
marker with higher priority. |
int |
REQUIRED
|
Set if the marker must be placed and may be
overlapped with other markers or labels. |
int |
REQUIRED_AND_HIDES_OPTIONAL
|
Set if the marker must be placed and will hide
any OPTIONAL_AND_HIDES_LOWER_PRIORITY markers or labels that would
overlap with the marker. |
Inherited Method Summary
From interface java.lang.annotation.Annotation
abstract Class<? extends Annotation>
|
annotationType()
|
abstract boolean |
|
abstract int |
hashCode()
|
abstract String
|
toString()
|
Constants
public static final int
OPTIONAL_AND_HIDES_LOWER_PRIORITY
Set if the marker may be replaced/overlapped by a required marker or replaced by an
OPTIONAL_AND_HIDES_LOWER_PRIORITY
marker with higher priority.
Constant Value: 2
public static final int
REQUIRED
Set if the marker must be placed and may be overlapped with other markers or labels.
This is the default behavior.
Constant Value: 0
public static final int
REQUIRED_AND_HIDES_OPTIONAL
Set if the marker must be placed and will hide any
OPTIONAL_AND_HIDES_LOWER_PRIORITY
markers or labels that would overlap
with the marker. It may be overlapped with other required markers.
Constant Value: 1
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["`AdvancedMarkerOptions.CollisionBehavior` is an annotation in the Google Maps Android API that defines how markers behave when they overlap with other markers or map labels."],["There are three collision behaviors: `REQUIRED`, `REQUIRED_AND_HIDES_OPTIONAL`, and `OPTIONAL_AND_HIDES_LOWER_PRIORITY`, controlling whether markers are displayed or hidden during overlaps."],["`REQUIRED` is the default behavior, ensuring the marker is always placed but can overlap with other markers; `REQUIRED_AND_HIDES_OPTIONAL` prioritizes the marker by hiding overlapping optional markers; `OPTIONAL_AND_HIDES_LOWER_PRIORITY` allows the marker to be hidden by higher priority or required markers."]]],["`AdvancedMarkerOptions.CollisionBehavior` defines how markers interact during collisions. It offers three settings: `OPTIONAL_AND_HIDES_LOWER_PRIORITY` (value 2) allows replacement by higher-priority markers, `REQUIRED` (value 0) ensures placement but permits overlap, and `REQUIRED_AND_HIDES_OPTIONAL` (value 1) mandates placement, hiding lower-priority markers. These settings control if a marker is visible, hidden, or able to overlap others. `Annotation` interface methods like `annotationType`, `equals`, `hashCode`, and `toString` are inherited.\n"]]