Çakışma davranışını kontrol etme
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Bu sayfada, bir işaretçinin çakışma davranışının nasıl ayarlanacağı gösterilmektedir.
Çakışma davranışı, bir işaretçinin başka bir işaretçiyle çakışması (üst üste gelmesi) durumunda nasıl görüntüleneceğini kontrol eder.
Çakışma davranışını ayarlamak için collisionBehavior
değerini aşağıdakilerden birine ayarlayın:
REQUIRED
: Çakışma olsa bile işaretçiyi her zaman göster
REQUIRED_AND_HIDES_OPTIONAL
: Çakışmadan bağımsız olarak işaretçiyi her zaman gösterir ve işaretçiyle çakışacak OPTIONAL_AND_HIDES_LOWER_PRIORITY
işaretçilerini veya etiketlerini gizler.
OPTIONAL_AND_HIDES_LOWER_PRIORITY
: İşaretçiyi yalnızca diğer işaretçilerle çakışmıyorsa gösterin. Bu türden iki işaretçi çakışırsa daha yüksek zIndex
değerine sahip olan gösterilir. Aynı zIndex
öğesine sahipse dikey ekran konumu daha altta olan gösterilir.
Aşağıdaki örnekte, bir işaretçi için çakışma davranışının nasıl ayarlanacağı gösterilmektedir:
const marker = new Marker3DElement({
position: {lat, lng},
collisionBehavior: google.maps.CollisionBehavior.REQUIRED
});
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-07-22 UTC.
[null,null,["Son güncelleme tarihi: 2025-07-22 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\u003cbr /\u003e\n\n| This product or feature is in Preview (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\n| descriptions](/maps/launch-stages).\n\n\u003cbr /\u003e\n\n\nThis page demonstrates how to set the collision behavior for a marker.\nCollision behavior controls how a marker will display if it collides (overlaps)\nwith another marker.\n\nTo set collision behavior, set `collisionBehavior` to one of the following:\n\n- `REQUIRED`: Always display the marker regardless of collision\n- `REQUIRED_AND_HIDES_OPTIONAL`: Always display the marker regardless of collision, and hide any `OPTIONAL_AND_HIDES_LOWER_PRIORITY` markers or labels that would overlap with the marker.\n- `OPTIONAL_AND_HIDES_LOWER_PRIORITY`: Display the marker only if it does not overlap with other markers. If two markers of this type would overlap, the one with the higher `zIndex` is shown. If they have the same `zIndex`, the one with the lower vertical screen position is shown.\n\nThe following example shows setting collision behavior for a marker: \n\n const marker = new Marker3DElement({\n position: {lat, lng},\n collisionBehavior: google.maps.CollisionBehavior.REQUIRED\n });"]]