dymaptic.GeoBlazor.Core
dymaptic.GeoBlazor.Core.Components.Geometries
Polygon Class
A polygon contains an array of rings and a spatialReference.
ArcGIS Maps SDK for JavaScript
public class Polygon : dymaptic.GeoBlazor.Core.Components.Geometries.Geometry
Inheritance System.Object 🡒 Microsoft.AspNetCore.Components.ComponentBase 🡒 MapComponent 🡒 Geometry 🡒 Polygon
Derived
↳ Circle
Constructors
Polygon() Constructor
Parameterless constructor for use as a Razor Component.
public Polygon();
Polygon(IReadOnlyList, SpatialReference, Point, Nullable, Nullable, Nullable) Constructor
Constructor for use in C# code. Use named parameters (e.g., item1: value1, item2: value2) to set properties in any order.
public Polygon(System.Collections.Generic.IReadOnlyList<dymaptic.GeoBlazor.Core.Model.MapPath> rings, dymaptic.GeoBlazor.Core.Components.SpatialReference? spatialReference=null, dymaptic.GeoBlazor.Core.Components.Geometries.Point? centroid=null, System.Nullable<bool> hasM=null, System.Nullable<bool> hasZ=null, System.Nullable<bool> isSelfIntersecting=null);
Parameters
rings
System.Collections.Generic.IReadOnlyList<MapPath>
An array of rings.
ArcGIS Maps SDK for JavaScript
spatialReference
SpatialReference
The spatial reference of the geometry.
default SpatialReference.WGS84 // wkid: 4326
ArcGIS Maps SDK for JavaScript
centroid
Point
The centroid of the polygon.
ArcGIS Maps SDK for JavaScript
hasM
System.Nullable<System.Boolean>
Indicates if the geometry has M values.
ArcGIS Maps SDK for JavaScript
hasZ
System.Nullable<System.Boolean>
Indicates if the geometry has z-values (elevation).
ArcGIS Maps SDK for JavaScript
isSelfIntersecting
System.Nullable<System.Boolean>
Checks to see if polygon rings cross each other and indicates if the polygon is
self-intersecting, which means the ring of the polygon crosses itself.
ArcGIS Maps SDK for JavaScript
Properties
Polygon.Centroid Property
The centroid of the polygon.
ArcGIS Maps SDK for JavaScript
public dymaptic.GeoBlazor.Core.Components.Geometries.Point? Centroid { get; set; }
Property Value
Polygon.IsSelfIntersecting Property
Checks to see if polygon rings cross each other and indicates if the polygon is self-intersecting, which means the ring of the polygon crosses itself.
ArcGIS Maps SDK for JavaScript
public System.Nullable<bool> IsSelfIntersecting { get; set; }
Property Value
System.Nullable<System.Boolean>
Polygon.Rings Property
An array of MapPath rings.
public System.Collections.Generic.IReadOnlyList<dymaptic.GeoBlazor.Core.Model.MapPath> Rings { get; set; }
Property Value
System.Collections.Generic.IReadOnlyList<MapPath>
Polygon.Type Property
The Geometry “type”, used internally to render.
public override dymaptic.GeoBlazor.Core.Enums.GeometryType Type { get; }
Property Value
Methods
Polygon.AddRing(IReadOnlyCollection) Method
Adds a ring to the Polygon.
ArcGIS Maps SDK for JavaScript
public System.Threading.Tasks.Task<dymaptic.GeoBlazor.Core.Components.Geometries.Polygon?> AddRing(System.Collections.Generic.IReadOnlyCollection<dymaptic.GeoBlazor.Core.Components.Geometries.Point> points);
Parameters
points
System.Collections.Generic.IReadOnlyCollection<Point>
A polygon ring. The first and last coordinates/points in the ring must be the same. This can either be defined as an array of Point geometries or an array of XY coordinates.
Returns
System.Threading.Tasks.Task<Polygon>
Polygon.Clone() Method
Returns a deep clone of the geometry.
public dymaptic.GeoBlazor.Core.Components.Geometries.Polygon Clone();
Returns
Polygon.Contains(Point) Method
Checks on the client if the input point is inside the polygon.
ArcGIS Maps SDK for JavaScript
public System.Threading.Tasks.Task<System.Nullable<bool>> Contains(dymaptic.GeoBlazor.Core.Components.Geometries.Point point);
Parameters
point
Point
The point to test whether it is contained within the testing polygon.
Returns
System.Threading.Tasks.Task<System.Nullable<System.Boolean>>
Polygon.GetCentroid() Method
Asynchronously retrieve the current value of the Centroid property.
public System.Threading.Tasks.Task<dymaptic.GeoBlazor.Core.Components.Geometries.Point?> GetCentroid();
Returns
System.Threading.Tasks.Task<Point>
Polygon.GetIsSelfIntersecting() Method
Asynchronously retrieve the current value of the IsSelfIntersecting property.
public System.Threading.Tasks.Task<System.Nullable<bool>> GetIsSelfIntersecting();
Returns
System.Threading.Tasks.Task<System.Nullable<System.Boolean>>
Polygon.GetPoint(int, int) Method
Returns a point specified by a ring and point in the path.
param pointIndex The index of the desired point within the ring.
ArcGIS Maps SDK for JavaScript
public System.Threading.Tasks.Task<dymaptic.GeoBlazor.Core.Components.Geometries.Point?> GetPoint(int ringIndex, int pointIndex);
Parameters
ringIndex
System.Int32
The index of the ring containing the desired point.
pointIndex
System.Int32
The index of the desired point within the ring.
Returns
System.Threading.Tasks.Task<Point>
Polygon.InsertPoint(int, int, Point) Method
Inserts a new point into the polygon.
param pointIndex The index of the point to insert within the ring.
ArcGIS Maps SDK for JavaScript
public System.Threading.Tasks.Task<dymaptic.GeoBlazor.Core.Components.Geometries.Polygon?> InsertPoint(int ringIndex, int pointIndex, dymaptic.GeoBlazor.Core.Components.Geometries.Point point);
Parameters
ringIndex
System.Int32
The index of the ring in which to insert the point.
pointIndex
System.Int32
The index of the point to insert within the ring.
point
Point
The point to insert.
Returns
System.Threading.Tasks.Task<Polygon>
Polygon.IsClockwise(IReadOnlyCollection) Method
Checks if a Polygon ring is clockwise.
ArcGIS Maps SDK for JavaScript
public System.Threading.Tasks.Task<System.Nullable<bool>> IsClockwise(System.Collections.Generic.IReadOnlyCollection<dymaptic.GeoBlazor.Core.Components.Geometries.Point> ring);
Parameters
ring
System.Collections.Generic.IReadOnlyCollection<Point>
A polygon ring. It can either be defined as an array of Point geometries or an array of XY coordinates.
Returns
System.Threading.Tasks.Task<System.Nullable<System.Boolean>>
Polygon.RemovePoint(int, int) Method
Removes a point from the polygon at the given pointIndex
within the ring identified by ringIndex
.
param pointIndex The index of the point to remove within the ring.
ArcGIS Maps SDK for JavaScript
public System.Threading.Tasks.Task<dymaptic.GeoBlazor.Core.Components.Geometries.Point?> RemovePoint(int ringIndex, int pointIndex);
Parameters
ringIndex
System.Int32
The index of the ring containing the point to remove.
pointIndex
System.Int32
The index of the point to remove within the ring.
Returns
System.Threading.Tasks.Task<Point>
Polygon.RemoveRing(int) Method
Removes a ring from the Polygon.
ArcGIS Maps SDK for JavaScript
public System.Threading.Tasks.Task<dymaptic.GeoBlazor.Core.Components.Geometries.Point[]?> RemoveRing(int index);
Parameters
index
System.Int32
The index of the ring to remove.
Returns
System.Threading.Tasks.Task<Point[]>
Polygon.SetPoint(int, int, Point) Method
Updates a point in the polygon.
param pointIndex The index of the point to update within the ring.
ArcGIS Maps SDK for JavaScript
public System.Threading.Tasks.Task<dymaptic.GeoBlazor.Core.Components.Geometries.Polygon?> SetPoint(int ringIndex, int pointIndex, dymaptic.GeoBlazor.Core.Components.Geometries.Point point);
Parameters
ringIndex
System.Int32
The index of the ring containing the point to update.
pointIndex
System.Int32
The index of the point to update within the ring.
point
Point
The new point geometry.