Class MarkerClusterController
- Namespace
- LansMap.Markers.Interaction
Clusters nearby markers into bubbles when zoomed out.
[DefaultExecutionOrder(-20)]
public sealed class MarkerClusterController : MonoBehaviour, IMapScreenSpaceOverlay
- Inheritance
-
objectObjectComponentBehaviourMonoBehaviourMarkerClusterController
- Implements
Fields
BubbleBaseSizePx
[Tooltip("Bubble diameter in px for a 2-marker cluster; grows with log2(count).")]
public float BubbleBaseSizePx
Field Value
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
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
ClusterLerpSeconds
[Tooltip("Bubbles glide to their new spot when the clustering recalculates. 0 = instant (project default style).")]
public float ClusterLerpSeconds
Field Value
ClusterRadiusPx
[Tooltip("Merge radius in screen pixels. Also the spacing between bubble centers.")]
public double ClusterRadiusPx
Field Value
ClusteringEnabled
[Tooltip("On/off. Use this field, not Component.enabled, so markers and labels come back correctly.")]
public bool ClusteringEnabled
Field Value
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
HoverOutlineWidthPx
[Tooltip("Hover outline width in screen px.")]
public float HoverOutlineWidthPx
Field Value
Map
[Tooltip("Map whose bulk markers are clustered. Works against either ScreenMapView or SurfaceMapView.")]
public BaseMapView Map
Field Value
MaxClusterZoom
[Tooltip("Cluster while zoom is below this; markers show unclustered above.")]
public double MaxClusterZoom
Field Value
Pointer
[NonSerialized]
public IMapPointerSurface Pointer
Field Value
Prefabs
[Tooltip("Prefab-tier manager to cluster with bulk. Empty skips prefabs.")]
public WorldMarkerManager Prefabs
Field Value
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
Properties
ClusterCount
Number of clusters currently on screen (single-marker dots and multi-member bubbles).
public int ClusterCount { get; }
Property Value
ClusterLabelCount
Number of live count-label widgets currently drawn for multi-member bubbles.
public int ClusterLabelCount { get; }
Property Value
Methods
RemoveAllLive(MarkerStore)
public static void RemoveAllLive(MarkerStore store)
Parameters
storeMarkerStore
RetainVisibleClusters(List<MarkerCluster>, MapViewTransform, double)
public static int RetainVisibleClusters(List<MarkerCluster> clusters, MapViewTransform view, double marginPx)
Parameters
clustersList<MarkerCluster>viewMapViewTransformmarginPxdouble
Returns
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()