Новый стиль базовой карты скоро появится на платформе Google Maps. Это обновление стиля карты включает новую цветовую палитру по умолчанию, модернизированные булавки, а также улучшения интерфейса и удобства использования карты. Все стили карт будут автоматически обновлены в марте 2025 г. Дополнительную информацию о доступности и о том, как принять участие раньше, см. в разделе Новый стиль карты для платформы Google Maps .
GMSCollisionBehaviorRequired (по умолчанию): всегда отображать маркер независимо от столкновения. Это поведение по умолчанию. Не влияет на отображение других маркеров или меток базовой карты.
GMSCollisionBehaviorOptionalAndHidesLowerPriority : отображать маркер только в том случае, если он не перекрывается с другими маркерами. Если два маркера этого типа перекрываются, отображается тот, у которого zIndex выше. Если они имеют одинаковый zIndex , отображается тот, у которого вертикальная позиция экрана ниже.
GMSCollisionBehaviorRequiredAndHidesOptional : всегда отображать маркер независимо от коллизии и скрывать любые GMSCollisionBehaviorOptionalAndHidesLowerPriority . Отображайте маркер только в том случае, если он не перекрывается с другими маркерами. Не GMSCollisionBehaviorRequired . Если два маркера этого типа перекрываются, отображается тот, у которого zIndex выше. Правила коллизий для маркеров с одинаковым zIndex не определены.
Быстрый
// Defines a marker to always display and hide any marker or label overlay with this marker in the base mapmarker.collisionBehavior=.requiredAndHidesOptional
Цель-C
// Defines a marker to always display and hide any marker or label overlay with this marker in the base mapmarker.collisionBehavior=GMSCollisionBehaviorRequiredAndHidesOptional
[null,null,["Последнее обновление: 2025-02-25 UTC."],[[["Collision behavior dictates how markers are displayed when they overlap on the map."],["You can configure a marker's collision behavior using the `GMSAdvancedMarker.collisionBehavior` property with three options: `GMSCollisionBehaviorRequired`, `GMSCollisionBehaviorOptionalAndHidesLowerPriority`, and `GMSCollisionBehaviorRequiredAndHidesOptional`."],["`GMSCollisionBehaviorRequired` is the default, always displaying the marker regardless of overlap."],["`GMSCollisionBehaviorOptionalAndHidesLowerPriority` displays the marker only if it doesn't overlap with others, prioritizing higher `zIndex` and lower screen position in case of conflicts."],["`GMSCollisionBehaviorRequiredAndHidesOptional` always displays the marker and hides any with `GMSCollisionBehaviorOptionalAndHidesLowerPriority` behavior."]]],["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"]]