Struct MarkerHandle
A live reference to one marker in a specific MarkerStore:
the store plus the id Add(LatLon, double, float, MarkerSizeMode, uint, MarkerShape, bool, float, float, MarkerAltitudeMode) returned for it.
Property-like members forward to the store's own Set*/read paths, so
a caller already holding a handle can write
handle.ShowStem = true instead of
store.SetShowStem(id, true).
public readonly struct MarkerHandle : IEquatable<MarkerHandle>
- Implements
Remarks
Distinct from MarkerRef: that type names a marker across bulk/prefab/world-bulk tiers with no store reference, for callers that pass a marker around without needing to mutate it directly. This type carries its own store and exists for the opposite case - a caller that just added or resolved one marker and wants to keep editing it without holding the store separately. Two handles built from the same id and the same store are interchangeable; nothing here is a second identity.
A stale handle (its marker removed, or its slot reused by a later Add(LatLon, double, float, MarkerSizeMode, uint, MarkerShape, bool, float, float, MarkerAltitudeMode)) behaves like a stale id everywhere else in this store: every setter here forwards to a Set* method that silently ignores a stale id, and every getter reads IsLive(int) first and returns the type's default rather than throwing or reading a resurrected slot's data.
Constructors
MarkerHandle(MarkerStore, int)
public MarkerHandle(MarkerStore store, int id)
Parameters
storeMarkerStoreidint
Properties
ApplyZoomRange
Whether this marker's stored zoom window hides it. See SetApplyZoomRange(int, bool).
public bool ApplyZoomRange { get; set; }
Property Value
Draggable
Whether this marker may be dragged. See SetDraggable(int, bool).
public bool Draggable { get; set; }
Property Value
Enabled
Whether this marker is drawn and pickable. See SetEnabled(int, bool).
public bool Enabled { get; set; }
Property Value
Flat
Whether this marker lies flat on the map plane. See SetFlat(int, bool).
public bool Flat { get; set; }
Property Value
Id
The id Add(LatLon, double, float, MarkerSizeMode, uint, MarkerShape, bool, float, float, MarkerAltitudeMode) returned for this marker.
public int Id { get; }
Property Value
IsLive
Whether this handle still owns a live marker.
public bool IsLive { get; }
Property Value
OutlineRgba
Outline color override, 0xRRGGBBAA. See SetOutlineColor(int, uint).
public uint OutlineRgba { get; set; }
Property Value
RotationDeg
Shape rotation in degrees. See SetRotation(int, float).
public float RotationDeg { get; set; }
Property Value
ShowStem
Draws or hides this marker's altitude stem. See SetShowStem(int, bool).
public bool ShowStem { get; set; }
Property Value
StemColorRgba
Stem color override, 0xRRGGBBAA. See SetStemColor(int, uint).
public uint StemColorRgba { get; set; }
Property Value
StemWidthPx
Stem width override in screen px. See SetStemWidth(int, float).
public float StemWidthPx { get; set; }
Property Value
Store
The store this marker lives in.
public MarkerStore Store { get; }
Property Value
Methods
Equals(MarkerHandle)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(MarkerHandle other)
Parameters
otherMarkerHandleAn object to compare with this object.
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Operators
implicit operator int(MarkerHandle)
Implicit conversion to the raw id: every existing
int id = store.Add(...) call site keeps compiling
unchanged now that Add(LatLon, double, float, MarkerSizeMode, uint, MarkerShape, bool, float, float, MarkerAltitudeMode) returns a
MarkerHandle.
public static implicit operator int(MarkerHandle handle)
Parameters
handleMarkerHandle