reviewsGet a Maps Demo Key:Try out select Maps JavaScript API and Places UI Kit features at no cost with a Maps Demo Key—no billing information required.
This page demonstrates how to set the collision behavior for a marker.
Collision behavior controls how a marker will display if it collides (overlaps)
with another marker.
To set collision behavior, setcollisionBehaviorto one of the following:
REQUIRED: Always display the marker regardless of collision
REQUIRED_AND_HIDES_OPTIONAL: Always display the marker regardless of
collision, and hide anyOPTIONAL_AND_HIDES_LOWER_PRIORITYmarkers or
labels that would overlap with the marker.
OPTIONAL_AND_HIDES_LOWER_PRIORITY: Display the marker only if it does not
overlap with other markers. If two markers of this type would overlap, the
one with the higherzIndexis shown. If they have the samezIndex, the
one with the lower vertical screen position is shown.
The following example shows setting collision behavior for a marker:
constmarker=newMarker3DElement({position:{lat,lng},// Try setting a different collision behavior here.collisionBehavior:'REQUIRED',});
[[["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 2026-06-15 UTC."],[],[]]