Table of Contents

Struct MarkerHandle

Namespace
LansMap.Core.Markers

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

store MarkerStore
id int

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

double

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

MarkerAltitudeMode

ApplyZoomRange

Whether this marker's stored zoom window hides it. See SetApplyZoomRange(int, bool).

public bool ApplyZoomRange { get; set; }

Property Value

bool

ColorRgba

public uint ColorRgba { get; set; }

Property Value

uint

Draggable

Whether this marker may be dragged. See SetDraggable(int, bool).

public bool Draggable { get; set; }

Property Value

bool

Enabled

Whether this marker is drawn and pickable. See SetEnabled(int, bool).

public bool Enabled { get; set; }

Property Value

bool

Flat

Whether this marker lies flat on the map plane. See SetFlat(int, bool).

public bool Flat { get; set; }

Property Value

bool

Id

public int Id { get; }

Property Value

int

IsLive

Whether this handle still owns a live marker.

public bool IsLive { get; }

Property Value

bool

OutlineRgba

Outline color override, 0xRRGGBBAA. See SetOutlineColor(int, uint).

public uint OutlineRgba { get; set; }

Property Value

uint

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

LatLon

RotationDeg

Shape rotation in degrees. See SetRotation(int, float).

public float RotationDeg { get; set; }

Property Value

float

Shape

public MarkerShape Shape { get; set; }

Property Value

MarkerShape

ShowStem

Draws or hides this marker's altitude stem. See SetShowStem(int, bool).

public bool ShowStem { get; set; }

Property Value

bool

SizeMode

Whether SizeParam is screen px or ground meters. See UpdateStyle(int, float, MarkerSizeMode, uint, MarkerShape).

public MarkerSizeMode SizeMode { get; set; }

Property Value

MarkerSizeMode

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

float

StemColorRgba

Stem color override, 0xRRGGBBAA. See SetStemColor(int, uint).

public uint StemColorRgba { get; set; }

Property Value

uint

StemWidthPx

Stem width override in screen px. See SetStemWidth(int, float).

public float StemWidthPx { get; set; }

Property Value

float

Store

The store this marker lives in.

public MarkerStore Store { get; }

Property Value

MarkerStore

Methods

Equals(MarkerHandle)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(MarkerHandle other)

Parameters

other MarkerHandle

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and 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

handle MarkerHandle

Returns

int