Table of Contents

Class MarkerClusterController

Clusters nearby markers into bubbles when zoomed out.

[DefaultExecutionOrder(-20)]
public sealed class MarkerClusterController : MonoBehaviour, IMapScreenSpaceOverlay
Inheritance
object
Object
Component
Behaviour
MonoBehaviour
MarkerClusterController
Implements

Fields

BubbleBaseSizePx

[Tooltip("Bubble diameter in px for a 2-marker cluster; grows with log2(count).")]
public float BubbleBaseSizePx

Field Value

float

BubbleColor

[Tooltip("Cluster bubble color.")]
public Color32 BubbleColor

Field Value

Color32

ClickFitPaddingPx

[Tooltip("Screen padding around the fitted members in px.")]
public double ClickFitPaddingPx

Field Value

double

ClickZoomInLevels

[Tooltip("Click a bubble: zoom to fit its members. This is the fallback step if fit fails. 0 = off.")]
public double ClickZoomInLevels

Field Value

double

ClusterLerpSeconds

[Tooltip("Bubbles glide to their new spot when the clustering recalculates. 0 = instant (project default style).")]
public float ClusterLerpSeconds

Field Value

float

ClusterRadiusPx

[Tooltip("Merge radius in screen pixels. Also the spacing between bubble centers.")]
public double ClusterRadiusPx

Field Value

double

ClusteringEnabled

[Tooltip("On/off. Use this field, not Component.enabled, so markers and labels come back correctly.")]
public bool ClusteringEnabled

Field Value

bool

HoverOutlineColor

[Tooltip("Hover outline color.")]
public Color32 HoverOutlineColor

Field Value

Color32

HoverOutlineEnabled

[Tooltip("Hovering a cluster bubble outlines the area its members cover.")]
public bool HoverOutlineEnabled

Field Value

bool

HoverOutlineWidthPx

[Tooltip("Hover outline width in screen px.")]
public float HoverOutlineWidthPx

Field Value

float

Map

[Tooltip("Map whose bulk markers are clustered. Works against either ScreenMapView or SurfaceMapView.")]
public BaseMapView Map

Field Value

BaseMapView

MaxClusterZoom

[Tooltip("Cluster while zoom is below this; markers show unclustered above.")]
public double MaxClusterZoom

Field Value

double

Pointer

[NonSerialized]
public IMapPointerSurface Pointer

Field Value

IMapPointerSurface

Prefabs

[Tooltip("Prefab-tier manager to cluster with bulk. Empty skips prefabs.")]
public WorldMarkerManager Prefabs

Field Value

WorldMarkerManager

RebuildOnMarkerMove

[Tooltip("Rebuild clustering when a marker moves, not only when markers are added or removed. Turn off if markers move often in a very large store: a rebuild is a whole-store pass, so even one constantly moving marker pays for all of them. Bubbles then stop following moves until markers are added or removed.")]
public bool RebuildOnMarkerMove

Field Value

bool

Properties

ClusterCount

Number of clusters currently on screen (single-marker dots and multi-member bubbles).

public int ClusterCount { get; }

Property Value

int

ClusterLabelCount

Number of live count-label widgets currently drawn for multi-member bubbles.

public int ClusterLabelCount { get; }

Property Value

int

Methods

RemoveAllLive(MarkerStore)

public static void RemoveAllLive(MarkerStore store)

Parameters

store MarkerStore

RetainVisibleClusters(List<MarkerCluster>, MapViewTransform, double)

public static int RetainVisibleClusters(List<MarkerCluster> clusters, MapViewTransform view, double marginPx)

Parameters

clusters List<MarkerCluster>
view MapViewTransform
marginPx double

Returns

int

ZeroSizeActiveBubbleCount()

Count of active bubble slots whose GPU size is 0 while their count label may already be drawing at full opacity - the exact shape of the "cluster label with no circle behind it on first load" bug (grow-in animation race, see suppressGrowInOnNextBuild).

public int ZeroSizeActiveBubbleCount()

Returns

int