# GoogleMaps Framework Reference

# GMSCollisionBehavior

    enum GMSCollisionBehavior : NSInteger {}

How markers interact with other markers and regular labels. Defaults to
`GMSCollisionBehaviorRequired`.

Marker collisions occur when coordinates intersect.

Priority is defined as:
1) Required \> Optional
2) zIndex: higher zIndex \> lower zIndex

Beyond this, it is undefined which marker will show if both are optional and have the same
zIndex.
Regular map labels are the lowest priority.
- `


  ### [GMSCollisionBehaviorRequired](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Enums/GMSCollisionBehavior#/c:@E@GMSCollisionBehavior@GMSCollisionBehaviorRequired)


  ` Always display the marker regardless of collision. This is the default behavior.
  Has no impact on whether any other markers or basemap labels show.

  #### Declaration

  Swift

      case required = 0

  Objective-C

      GMSCollisionBehaviorRequired

- `


  ### [GMSCollisionBehaviorRequiredAndHidesOptional](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Enums/GMSCollisionBehavior#/c:@E@GMSCollisionBehavior@GMSCollisionBehaviorRequiredAndHidesOptional)


  ` Always display the marker regardless of collision, and hide any
  CollisionBehaviorOptionalAndHidesLowerPriority markers or labels that would overlap with the
  marker.

  #### Declaration

  Swift

      case requiredAndHidesOptional = 1

  Objective-C

      GMSCollisionBehaviorRequiredAndHidesOptional

- `


  ### [GMSCollisionBehaviorOptionalAndHidesLowerPriority](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Enums/GMSCollisionBehavior#/c:@E@GMSCollisionBehavior@GMSCollisionBehaviorOptionalAndHidesLowerPriority)


  ` Display the marker only if it does not overlap with other markers. Does not include
  `https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Enums/GMSCollisionBehavior.html#/c:@E@GMSCollisionBehavior@GMSCollisionBehaviorRequired`. If two markers of this type would overlap, the one with the
  higher zIndex is shown. Collision rules for markers with the same zIndex is undefined.

  #### Declaration

  Swift

      case optionalAndHidesLowerPriority = 2

  Objective-C

      GMSCollisionBehaviorOptionalAndHidesLowerPriority