Class PrefabMarkerInstance
public sealed class PrefabMarkerInstance : IMapFollowTarget
- Inheritance
-
objectPrefabMarkerInstance
- 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
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
HeadingDeg
public double HeadingDeg
Field Value
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
HoverScaleOverride
public float? HoverScaleOverride
Field Value
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
Scale
public float Scale
Field Value
SizeMode
public MarkerSizeMode SizeMode
Field Value
Properties
AltitudeMeters
public double AltitudeMeters { get; }
Property Value
AltitudeMode
How AltitudeMeters is interpreted. Default RelativeToGround: meters above sampled ground. See ResolveAltitudeMercator(MarkerAltitudeMode, double, LatLon, IElevationSampler).
public MarkerAltitudeMode AltitudeMode { get; }
Property Value
GameObject
public GameObject GameObject { get; }
Property Value
- GameObject
HoverText
public string HoverText { get; set; }
Property Value
Id
Slot+generation id the owning manager handed out. -1 until assigned. Use Ref to compare across tiers.
public int Id { get; }
Property Value
IsLive
False once this marker has been despawned; a MapFollowController following it then stops.
public bool IsLive { get; }
Property Value
Label
public string Label { get; set; }
Property Value
Latitude
public double Latitude { get; }
Property Value
Longitude
public double Longitude { get; }
Property Value
Name
public string Name { get; set; }
Property Value
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
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
Ref
Cross-tier name for this GameObject marker.
public MarkerRef Ref { get; }
Property Value
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
Tier
public MarkerTier Tier { get; }
Property Value
UsesColliderHitArea
public bool UsesColliderHitArea { get; }
Property Value
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
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.boundswould 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
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
latdoubleLatitude in degrees WGS84.
londoubleLongitude in degrees WGS84.
altitudeMetersdoubleAuthored altitude in meters; meaning depends on
altitudeMode.altitudeModeMarkerAltitudeModeHow
altitudeMetersis 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
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
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
DragStarted
Fires the frame drag capture begins, through TryBeginDrag() or the Draggable long-press path.
public event Action<PrefabMarkerInstance> DragStarted
Event Type
HoverEntered
Fires when pointer hover enters this marker.
public event Action<PrefabMarkerInstance> HoverEntered
Event Type
HoverExited
Fires when pointer hover leaves this marker.
public event Action<PrefabMarkerInstance> HoverExited
Event Type
LongPressed
Fires once when a held primary-pointer press reaches the long-press threshold.
public event Action<PrefabMarkerInstance> LongPressed
Event Type
PositionChanged
public event Action<PrefabMarkerInstance> PositionChanged
Event Type
Pressed
Fires when this marker receives a primary-pointer press.
public event Action<PrefabMarkerInstance> Pressed
Event Type
Released
Fires when the primary pointer is released after pressing this marker.
public event Action<PrefabMarkerInstance> Released