GMSCollisionBehaviorRequired (Mặc định): Luôn hiển thị điểm đánh dấu bất kể có va chạm hay không. Đây là hành vi mặc định. Không ảnh hưởng đến việc có hiển thị bất kỳ điểm đánh dấu hoặc nhãn bản đồ cơ sở nào khác hay không.
GMSCollisionBehaviorOptionalAndHidesLowerPriority: Chỉ hiển thị điểm đánh dấu nếu điểm đó không chồng lên các điểm đánh dấu khác. Nếu hai điểm đánh dấu thuộc loại này chồng lên nhau, thì điểm đánh dấu có zIndex cao hơn sẽ được hiển thị. Nếu chúng có cùng zIndex, thì điểm đánh dấu có vị trí dọc thấp hơn trên màn hình sẽ được hiển thị.
GMSCollisionBehaviorRequiredAndHidesOptional: Luôn hiển thị điểm đánh dấu bất kể có va chạm hay không và ẩn mọi GMSCollisionBehaviorOptionalAndHidesLowerPriority. Chỉ hiển thị điểm đánh dấu nếu điểm đó không chồng lên các điểm đánh dấu khác. Không GMSCollisionBehaviorRequired. Nếu hai điểm đánh dấu thuộc loại này chồng lên nhau, thì điểm đánh dấu có zIndex cao hơn sẽ được hiển thị. Quy tắc va chạm cho các điểm đánh dấu có cùng zIndex chưa được xác định.
Swift
// Defines a marker to always display and hide any marker or label overlay with this marker in the base mapmarker.collisionBehavior=.requiredAndHidesOptional
Objective-C
// Defines a marker to always display and hide any marker or label overlay with this marker in the base mapmarker.collisionBehavior=GMSCollisionBehaviorRequiredAndHidesOptional
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2026-05-29 UTC."],[],["Collision behavior dictates marker display during overlaps. Options include: `Required` (always visible, default); `OptionalAndHidesLowerPriority` (visible only if no overlap, higher `zIndex` prevails); and `RequiredAndHidesOptional` (always visible, hides `OptionalAndHidesLowerPriority`). `zIndex` determines priority in overlapping markers, with lower vertical screen position breaking ties in specific cases. Setting `collisionBehavior` in code allows customization of display logic. It's recommended to use the same behavior for all advanced markers.\n"]]