Table of Contents

Class PrefabMarkerInstance

Namespace
LansMap.Markers.World
Assembly
LansMap.Runtime.dll
public sealed class PrefabMarkerInstance : IMapFollowTarget
Inheritance
object
PrefabMarkerInstance
Implements

Fields

CaptionFontOverride

public Font CaptionFontOverride

Field Value

Font

CaptionFontSizeOverride

public int? CaptionFontSizeOverride

Field Value

int?

CaptionTextColorOverride

public Color? CaptionTextColorOverride

Field Value

Color?

Draggable

Opt-in: a long press on this marker begins a drag automatically. Default false. Same name and default as the bulk tier's MarkerHandle.Draggable, so a buyer learns it once. TryBeginDrag() stays available as the programmatic path regardless of this flag.

public bool Draggable

Field Value

bool

DrawLabelsOverride

public bool? DrawLabelsOverride

Field Value

bool?

Enabled

Authoring on/off. Default true. Zoom and offscreen hiding can still conceal an enabled marker. False must not be implemented as SetActive alone: the manager overwrites active every frame.

public bool Enabled

Field Value

bool

HeadingDeg

public double HeadingDeg

Field Value

double

HideOffscreenMarkersOverride

public bool? HideOffscreenMarkersOverride

Field Value

bool?

HoverBackgroundOverride

public Color? HoverBackgroundOverride

Field Value

Color?

HoverFontOverride

public Font HoverFontOverride

Field Value

Font

HoverFontSizeOverride

public int? HoverFontSizeOverride

Field Value

int?

HoverRadiusPxOverride

public float? HoverRadiusPxOverride

Field Value

float?

HoverScaleOverride

public float? HoverScaleOverride

Field Value

float?

HoverTextColorOverride

public Color? HoverTextColorOverride

Field Value

Color?

LockToMapRotationOverride

public bool? LockToMapRotationOverride

Field Value

bool?

ModelUpIsYOverride

public bool? ModelUpIsYOverride

Field Value

bool?

OffscreenMarginPxOverride

public float? OffscreenMarginPxOverride

Field Value

float?

Scale

public float Scale

Field Value

float

SizeMode

public MarkerSizeMode SizeMode

Field Value

MarkerSizeMode

Properties

AltitudeMeters

public double AltitudeMeters { get; }

Property Value

double

AltitudeMode

public MarkerAltitudeMode AltitudeMode { get; }

Property Value

MarkerAltitudeMode

GameObject

public GameObject GameObject { get; }

Property Value

GameObject

HoverText

public string HoverText { get; set; }

Property Value

string

Id

Slot+generation id the owning manager handed out. -1 until assigned. Use Ref to compare across tiers.

public int Id { get; }

Property Value

int

IsLive

False once this marker has been despawned; a MapFollowController following it then stops.

public bool IsLive { get; }

Property Value

bool

Label

public string Label { get; set; }

Property Value

string

Latitude

public double Latitude { get; }

Property Value

double

Longitude

public double Longitude { get; }

Property Value

double

Name

public string Name { get; set; }

Property Value

string

Owner

The manager that spawned this marker, fixed for its lifetime. Lets a consumer confirm this marker still belongs to a given view's currently registered manager before starting drag capture through it.

public PrefabMarkerManager Owner { get; }

Property Value

PrefabMarkerManager

Position

Current position, derived from Latitude and Longitude. Read every frame by a MapFollowController while this marker is followed.

public LatLon Position { get; }

Property Value

LatLon

Ref

Cross-tier name for this GameObject marker.

public MarkerRef Ref { get; }

Property Value

MarkerRef

ResolvedAltitudeMercator

The altitude actually used for rendering, in mercator units above the flat reference plane, after AltitudeMode resolution against sampled ground. Maintained by the owning PrefabMarkerManager on every projection refresh; consumers that need the marker's real rendered position (such as MarkerPopup) read this instead of recomputing from AltitudeMeters directly, which would bypass mode resolution and terrain sampling.

public double ResolvedAltitudeMercator { get; }

Property Value

double

Tier

Always Prefab after the manager assigns an id. Meaningless while Id is negative.

public MarkerTier Tier { get; }

Property Value

MarkerTier

UsesColliderHitArea

public bool UsesColliderHitArea { get; }

Property Value

bool

VisualBoundsRadius

Max distance in prefab-local units from the anchor (local origin) to any corner of any renderer's local bounds, composed child-to-root. Multiplied by the marker's apparent on-screen size to widen the offscreen-visibility margin (VisibilityMarginPx(double, double, double)). 1 when no render geometry is found - the pre-measurement assumption, so a renderer-less marker behaves exactly as before. Settable directly for models whose visual extent the measurement cannot see (procedural growth, animation extremes).

public float VisualBoundsRadius { get; set; }

Property Value

float

Methods

CancelDrag()

Ends drag capture started by TryBeginDrag(). A no-op if this marker is not the one being dragged.

public void CancelDrag()

RefreshHitArea()

public void RefreshHitArea()

RefreshVisualBounds()

Re-measures VisualBoundsRadius from the render geometry currently under the marker GameObject. Called once at spawn, alongside RefreshHitArea(); call it again after adding, removing, or rescaling renderers on a live marker.

public void RefreshVisualBounds()

Remarks

Walks every UnityEngine.MeshRenderer (via its sibling UnityEngine.MeshFilter) and UnityEngine.SkinnedMeshRenderer under GameObject. Each one's authored local mesh bounds (center + extents, axis-aligned in the child's own local space) contributes its 8 corners, each transformed into the root's local space by root.worldToLocalMatrix * child.localToWorldMatrix

  • child-to-root composition, deliberate, because at spawn time the root has not yet been posed by the manager, and a world-space Renderer.bounds would bake that arbitrary transient pose into the number. Corners, not the box's center/extent, because a child transform can rotate or non-uniformly scale the box, which the composed matrix carries correctly per corner but an axis-aligned center+extent reconstruction in root space would not. Each transformed corner feeds FarthestCornerDistance(double, double, double, double, double, double, double, double, double) as a zero-size box, so the same pure corner-distance law measures both this per-corner walk and the flag/tower cases its own test plan pins directly. Falls back to 1 when no renderer is found, or the composed radius comes out at or below 0, reproducing today's shipped "assume 1 local unit" behavior exactly.

SetPosition(double, double, double)

public void SetPosition(double lat, double lon, double altitudeMeters)

Parameters

lat double
lon double
altitudeMeters double

SetPosition(double, double, double, MarkerAltitudeMode)

Moves the marker and/or changes how altitudeMeters is interpreted.

public void SetPosition(double lat, double lon, double altitudeMeters, MarkerAltitudeMode altitudeMode)

Parameters

lat double

Latitude in degrees WGS84.

lon double

Longitude in degrees WGS84.

altitudeMeters double

Authored altitude in meters; meaning depends on altitudeMode.

altitudeMode MarkerAltitudeMode

How altitudeMeters is resolved against sampled ground.

TryBeginDrag()

Starts pointer-driven drag capture for this marker: while held, its position follows the pointer and PositionChanged fires on every move. Requires this marker to already be pressed and past its owning manager's long-press threshold under a held primary button; call from a LongPressed handler.

public bool TryBeginDrag()

Returns

bool

True once capture began; false if the marker was not eligible.

Events

Clicked

Fires after a released short press resolves as a click.

public event Action<PrefabMarkerInstance> Clicked

Event Type

Action<PrefabMarkerInstance>

DragEnded

Fires once when drag capture ends, on release or CancelDrag(), with the marker's position at that moment. No revert; no cancelled flag.

public event Action<PrefabMarkerInstance, LatLon> DragEnded

Event Type

Action<PrefabMarkerInstance, LatLon>

DragMoved

Fires on every drag frame the pointer has a position, after PositionChanged for that same move.

public event Action<PrefabMarkerInstance, LatLon> DragMoved

Event Type

Action<PrefabMarkerInstance, LatLon>

DragStarted

Fires the frame drag capture begins, through TryBeginDrag() or the Draggable long-press path.

public event Action<PrefabMarkerInstance> DragStarted

Event Type

Action<PrefabMarkerInstance>

HoverEntered

Fires when pointer hover enters this marker.

public event Action<PrefabMarkerInstance> HoverEntered

Event Type

Action<PrefabMarkerInstance>

HoverExited

Fires when pointer hover leaves this marker.

public event Action<PrefabMarkerInstance> HoverExited

Event Type

Action<PrefabMarkerInstance>

LongPressed

Fires once when a held primary-pointer press reaches the long-press threshold.

public event Action<PrefabMarkerInstance> LongPressed

Event Type

Action<PrefabMarkerInstance>

PositionChanged

public event Action<PrefabMarkerInstance> PositionChanged

Event Type

Action<PrefabMarkerInstance>

Pressed

Fires when this marker receives a primary-pointer press.

public event Action<PrefabMarkerInstance> Pressed

Event Type

Action<PrefabMarkerInstance>

Released

Fires when the primary pointer is released after pressing this marker.

public event Action<PrefabMarkerInstance> Released

Event Type

Action<PrefabMarkerInstance>