// Collision behavior can only be changed in the AdvancedMarkerOptions object.// Changes to collision behavior after a marker has been created are not possiblevalcollisionBehavior:Int=CollisionBehavior.REQUIRED_AND_HIDES_OPTIONALvaladvancedMarkerOptions:AdvancedMarkerOptions=AdvancedMarkerOptions().position(LatLng(10.0,10.0)).collisionBehavior(collisionBehavior)valmarker:Marker=map.addMarker(advancedMarkerOptions)?:error("Failed to add marker")
Java
// Collision behavior can only be changed in the AdvancedMarkerOptions object.// Changes to collision behavior after a marker has been created are not possibleintcollisionBehavior=AdvancedMarkerOptions.CollisionBehavior.REQUIRED_AND_HIDES_OPTIONAL;AdvancedMarkerOptionsoptions=newAdvancedMarkerOptions().position(newLatLng(10.0,10.0)).collisionBehavior(collisionBehavior);Markermarker=map.addMarker(options);
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2024-12-03 UTC。"],[[["The Beta version of the SDK used for marker collision management is deprecated; migrate to the GA release for advanced markers to control this behavior."],["Marker and label collision management requires using a map ID and is unavailable in lite mode with bitmap images."],["You can prioritize marker display using the `Marker.CollisionBehavior` property with options like `REQUIRED`, `OPTIONAL_AND_HIDES_LOWER_PRIORITY`, and `REQUIRED_AND_HIDES_OPTIONAL`."],["The `CollisionBehavior` property must be set during marker creation using `AdvancedMarkerOptions` and cannot be changed afterwards."]]],["The Beta SDK is deprecated; use the GA release of advanced markers instead. Use the Migration Tool to transition from the Beta version. To manage marker and label collisions, use a map ID, not lite mode. Set marker priority with the `CollisionBehavior` property, choosing from `REQUIRED`, `OPTIONAL_AND_HIDES_LOWER_PRIORITY`, or `REQUIRED_AND_HIDES_OPTIONAL`. Higher `zIndex` values indicate higher priority for optional markers. `CollisionBehavior` can only be set in the `AdvancedMarkerOptions` object when the marker is created.\n"]]