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, which names a marker across tiers with no store reference. Same id plus same store = same handle. A stale handle (removed, or its slot reused) ignores every setter and reads every getter as the type's default. Position, altitude and the four style setters check IsLive explicitly - required for style, since UpdateStyle(int, float, MarkerSizeMode, uint, MarkerShape) alone throws on a stale id; the rest lean on their own store method's own no-op.
Constructors
MarkerHandle(MarkerStore, int)
public MarkerHandle(MarkerStore store, int id)
Parameters
storeMarkerStoreidint
Properties
AltitudeMeters
Authored altitude in meters, read against AltitudeMode. Writing keeps the position and mode. See GetAuthoredAltitude(int).
public double AltitudeMeters { get; set; }
Property Value
AltitudeMode
How AltitudeMeters is resolved against the ground. Writing re-resolves the stored meters under the new mode at the current position.
public MarkerAltitudeMode AltitudeMode { get; set; }
Property Value
ApplyZoomRange
Whether this marker's stored zoom window hides it. See SetApplyZoomRange(int, bool).
public bool ApplyZoomRange { get; set; }
Property Value
ColorRgba
Fill color, 0xRRGGBBAA. See UpdateStyle(int, float, MarkerSizeMode, uint, MarkerShape).
public uint ColorRgba { 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
Position
Where this marker sits, in degrees WGS84; latitude is clamped to the Web Mercator range on write and reads back clamped. Writing keeps the authored altitude and altitude mode. See UpdatePosition(int, LatLon, double).
public LatLon Position { get; set; }
Property Value
RotationDeg
Shape rotation in degrees. See SetRotation(int, float).
public float RotationDeg { get; set; }
Property Value
Shape
Shape drawn for this marker. See UpdateStyle(int, float, MarkerSizeMode, uint, MarkerShape).
public MarkerShape Shape { get; set; }
Property Value
ShowStem
Draws or hides this marker's altitude stem. See SetShowStem(int, bool).
public bool ShowStem { get; set; }
Property Value
SizeMode
Whether SizeParam is screen px or ground meters. See UpdateStyle(int, float, MarkerSizeMode, uint, MarkerShape).
public MarkerSizeMode SizeMode { get; set; }
Property Value
SizeParam
Size in screen px or ground meters according to SizeMode. Zero or negative hides the marker; NaN or infinity throws. See UpdateStyle(int, float, MarkerSizeMode, uint, MarkerShape).
public float SizeParam { 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