Select platform: [Android](https://developers.google.com/maps/documentation/maps-3d/android-sdk/configure-marker-collision-behavior.md.txt "View this page for the Android platform docs.") [iOS](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/configure-marker-collision-behavior.md.txt "View this page for the iOS platform docs.") [JavaScript](https://developers.google.com/maps/documentation/javascript/3d/marker-collision.md.txt "View this page for the JavaScript platform docs.")

<br />

You can customize the collision behavior of markers that you add to a 3D map.

![A map view showing marker collision behavior](https://developers.google.com/static/maps/documentation/maps-3d/ios-sdk/images/marker-collision.png)

The following code sample demonstrates how to configure the
[`collisionBehavior`](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/reference/Structs/Marker3D.md.txt#collisionbehavior)
of a `Marker3D` to specify how a marker should behave if it collides (overlaps)
with another marker or map label.

```swift
Map(camera: $camera, mode: .hybrid) {
  Marker3D(
     position: .init(
        latitude: 37.794724,
        longitude:  -122.39442,
        altitude: 100.0),
      altitudeMode: .relativeToMesh,
      collisionBehavior: .optionalAndHidesLowerPriority,
      extruded: true,
      label: "Marker 1"
    )

    Marker3D(
      position: .init(
          latitude: 37.7943220,
          longitude: -122.395073,
          altitude: 100.0),
      altitudeMode: .relativeToMesh,
      collisionBehavior: .required,
      extruded: true,
      label: "Marker 2"
    )

    Marker3D(
      position: .init(
          latitude: 37.7934108,
          longitude: -122.396144,
          altitude: 100.0),
      altitudeMode: .relativeToMesh,
      collisionBehavior: .requiredAndHidesOptional,
      extruded: true,
      label: "Marker 3"
    )
}
```