İşaretçi çarpışma davranışını yapılandırma
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
3D haritaya eklediğiniz işaretçilerin çakışma davranışını özelleştirebilirsiniz.
Aşağıdaki kod örneğinde, bir işaretçi başka bir işaretçiyle veya harita etiketiyle çarpıştığında nasıl davranacağını belirtmek için Marker
yapısının collisionBehavior
alanının nasıl yapılandırılacağı gösterilmektedir.
Swift
Map(camera: $camera, mode: .hybrid) {
Marker(
position: .init(
latitude: 37.794724,
longitude: -122.39442,
altitude: 100.0),
altitudeMode: .relativeToMesh,
collisionBehavior: .optionalAndHidesLowerPriority,
extruded: true,
label: "Marker 1"
)
Marker(
position: .init(
latitude: 37.7943220,
longitude: -122.395073,
altitude: 100.0),
altitudeMode: .relativeToMesh,
collisionBehavior: .required,
extruded: true,
label: "Marker 2"
)
Marker(
position: .init(
latitude: 37.7934108,
longitude: -122.396144,
altitude: 100.0),
altitudeMode: .relativeToMesh,
collisionBehavior: .requiredAndHidesOptional,
extruded: true,
label: "Marker 3"
)
}
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-08-31 UTC.
[null,null,["Son güncelleme tarihi: 2025-08-31 UTC."],[],[],null,["Select platform: [Android](/maps/documentation/maps-3d/android-sdk/configure-marker-collision-behavior \"View this page for the Android platform docs.\") [iOS](/maps/documentation/maps-3d/ios-sdk/configure-marker-collision-behavior \"View this page for the iOS platform docs.\") [JavaScript](/maps/documentation/javascript/3d/marker-collision \"View this page for the JavaScript platform docs.\")\n\n\u003cbr /\u003e\n\n| This product or feature is Experimental (pre-GA). Pre-GA products and features might have limited support, and changes to pre-GA products and features might not be compatible with other pre-GA versions. Pre-GA Offerings are covered by the [Google\n| Maps Platform Service Specific Terms](https://cloud.google.com/maps-platform/terms/maps-service-terms). For more information, see the [launch stage descriptions](/maps/launch-stages).\n\n\nYou can customize the collision behavior of markers that you add to a 3D map.\n\nThe following code sample demonstrates how configure the [`collisionBehavior` of the `Marker` struct](/maps/documentation/maps-3d/ios-sdk/reference/Structs/Marker#collisionbehavior) to specify how a marker should behave when it collides with anothermarker or map label. \n\nSwift\n\n```\nMap(camera: $camera, mode: .hybrid) {\n Marker(\n position: .init(\n latitude: 37.794724,\n longitude: -122.39442,\n altitude: 100.0),\n altitudeMode: .relativeToMesh,\n collisionBehavior: .optionalAndHidesLowerPriority,\n extruded: true,\n label: \"Marker 1\"\n )\n \n Marker(\n position: .init(\n latitude: 37.7943220,\n longitude: -122.395073,\n altitude: 100.0),\n altitudeMode: .relativeToMesh,\n collisionBehavior: .required,\n extruded: true,\n label: \"Marker 2\"\n )\n \n Marker(\n position: .init(\n latitude: 37.7934108,\n longitude: -122.396144,\n altitude: 100.0),\n altitudeMode: .relativeToMesh,\n collisionBehavior: .requiredAndHidesOptional,\n extruded: true,\n label: \"Marker 3\"\n )\n}\n \n```"]]