Select to view content in your preferred language

Select and Delete feature ,overlapped polygon problem

1878
10
11-09-2011 10:23 AM
ForamParikh
Regular Contributor
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
0 Kudos
10 Replies
ForamParikh
Regular Contributor
Thanks jennifer for response.but i as i told you my both features are not available on map..at a time i can see only one feature i have two features polygon and point but as i have set the resolution i can only see one feature at a time but when user hit delete at that time both features should remove so do you know any other solution i mean how can i delete both feature together?or can i add temporary other feature on graphical layer and then can i remove that feature?

Please advise,
Foram
0 Kudos