می توانید رفتار برخورد نشانگرهایی را که به نقشه سه بعدی اضافه می کنید سفارشی کنید.
نمونه کد زیر نحوه پیکربندی collisionBehavior ساختار Marker را نشان میدهد تا مشخص کند نشانگر در هنگام برخورد با نشانگر یا برچسب نقشه چگونه باید رفتار کند.
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی."],[],[],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```"]]