CreateMapPoint(Double,Double,SpatialReference) Method
Convenience method to create a
MapPoint instance with the given X and Y coordinates.
Construct a Polyline - from an enumeration of MapPoints
// Use a builderEx convenience method or a builderEx constructor.
// neither need to run on the MCT
MapPoint startPt = MapPointBuilderEx.CreateMapPoint(1.0, 1.0);
MapPoint endPt = MapPointBuilderEx.CreateMapPoint(2.0, 1.0);
List<MapPoint> list = new List<MapPoint>();
list.Add(startPt);
list.Add(endPt);
Polyline polyline = PolylineBuilderEx.CreatePolyline(list, SpatialReferences.WGS84);
// use AttributeFlags.None since we only have 2D points in the list
PolylineBuilderEx pb = new PolylineBuilderEx(list, AttributeFlags.None);
pb.SpatialReference = SpatialReferences.WGS84;
Polyline polyline2 = pb.ToGeometry();
// use AttributeFlags.NoAttributes because we only have 2d points in the list
Polyline polyline4 = PolylineBuilderEx.CreatePolyline(list, AttributeFlags.None);
Target Platforms: Windows 11, Windows 10, Windows 8.1
ArcGIS Pro version: 2.8 or higher.