Hi,
How to create a PolygonShape from a list of vertices ( list of points with Xs and Ys)? and how to display the PolygonShape on the map?
Any code samples will be appreicated. Thanks.
Katherine
Hi,
How to create a PolygonShape from a list of vertices ( list of points with Xs and Ys)? and how to display the PolygonShape on the map?
Any code samples will be appreicated. Thanks.
Katherine
Hi Kathy,
here is how to create a polygoneshape:
PolygonShape pg = new PolygonShape();
foreach (…)
pg.OuterRing.Vertices.Add(new Vertex(x, y));
And how to add it on a layer:
l = new ShapeFileFeatureLayer(al.ShapeExFileName, ShapeFileReadWriteMode.ReadWrite);
l.Open();
l.EditTools.BeginTransaction();
l.EditTools.Add(pg);
l.EditTools.CommitTransaction();
l.Close();
Hope this helps,
Patrick.
Thanks Patrick for your assistance!