Struct PolygonHandle
A live reference to one polygon in a specific PolygonLayer's store: the layer plus the id its AddPolygon(int, Color32) returned for it.
public readonly struct PolygonHandle
- Inherited Members
Remarks
Every member here is a single PolygonStore call; the struct holds no state of its own. A caller whose ring is recomputed every frame from live state calls SetPositions(IReadOnlyList<LatLon>) each frame instead of removing and re-adding, the same reason SetPositions(IReadOnlyList<LatLon>) exists.
Properties
Color
Fill color.
public Color32 Color { get; set; }
Property Value
- Color32
Id
The id the layer's Add call returned for this polygon.
public int Id { get; }
Property Value
IsLive
False after removal; every other member is a no-op read or write then.
public bool IsLive { get; }
Property Value
LastRefusal
Why the last SetPositions(IReadOnlyList<LatLon>) call was refused; None when it was accepted or the polygon has never been rewritten since add.
public PolygonStore.Rejection LastRefusal { get; }
Property Value
Layer
The layer this polygon lives in.
public PolygonLayer Layer { get; }
Property Value
PointCount
Ring vertices currently drawn; 0 while hidden.
public int PointCount { get; }
Property Value
Methods
SetPositions(IReadOnlyList<LatLon>)
Rewrites the polygon's ring, latitude first, degrees WGS84. Fewer than three points hides the polygon; a self-intersecting or zero-area ring keeps the previous fill and sets LastRefusal.
public void SetPositions(IReadOnlyList<LatLon> points)
Parameters
pointsIReadOnlyList<LatLon>