I am having trouble in Delete the feature.I am writing this code
Graphic g2 = new Graphic();
g2.Geometry = graphicsLayer.Graphics[0].Geometry;
FeatureLayer fl = new FeatureLayer();
fl = MyMap.Layers["fl"] as FeatureLayer;
fl.Graphics.Remove(g2);
but it is not working please help me in delete the feature.
also if any one know about overlapped polygon means if user draw single polygon and then again he draw second overlapped polygon then it should prompt me that overlapped polygon is not allowed.how i can know that user has drawn separate polygons or overlapped polygons?
to combine the multiple polygon i am using below code
ESRI.ArcGIS.Client.Geometry.Polygon a = new ESRI.ArcGIS.Client.Geometry.Polygon();
foreach (Graphic g in graphicsLayer.Graphics)
{
ESRI.ArcGIS.Client.Geometry.Polygon p=g.Geometry as ESRI.ArcGIS.Client.Geometry.Polygon;
foreach(ESRI.ArcGIS.Client.Geometry.PointCollection pointcell in p.Rings)
{
a.Rings.Add(pointcell);
}
}
graphicsLayer.Graphics.Clear();
Graphic g1 = new Graphic();
g1.Geometry = a;
g1.Symbol = LayoutRoot.Resources["DrawFillSymbol1"] as ESRI.ArcGIS.Client.Symbols.Symbol;
graphicsLayer.Graphics.Add(g1);
and if the polygon is overlapped then i am not able to save it in feature layer that's why i want prompt message after draw or any one know how i can combine overlapped polygon into one?and save it on feature layer.
Please help,
Thanks
Foram