AnsweredAssumed Answered

Polygon intersection selects unselected graphics on user drawn polygon.

Question asked by geonetadmin on Apr 26, 2012
Latest reply on May 9, 2012 by geonetadmin
Original User: e_saurabh

   I have a small problem. i have some graphics on my base map. Now I do a Intersect for the graphics using polygon.Extent.Intersects(graphic.Geometry.Extent). This selects the different shapes on the map on which the polygon is drawn. But this also selects the graphics nearby with that comes around that selected graphic features which is not selected. I need to avoid this. Can anybody provide some light on it. I am using

VS 2010.
Silverlight 4.

I am using the code

GraphicsLayer graphicLayer = edmsMap.Layers[selectedProgramTypeName] as GraphicsLayer;
GraphicCollection graphicCollection = new GraphicCollection();
graphicCollection = graphicLayer.Graphics;
foreach (Graphic graphic in graphicCollection)
     if (polygon.Extent.Intersects(graphic.Geometry.Extent))
         ESRI.ArcGIS.Client.Symbols.SimpleFillSymbol FillSymbol;
        FillSymbol = (ESRI.ArcGIS.Client.Symbols.SimpleFillSymbol)(LayoutRoot.Resources        ["PolygonSelectSymbol"]);
     graphic.Symbol = (ESRI.ArcGIS.Client.Symbols.SimpleFillSymbol)FillSymbol;
My xaml code is

<esriSymbols:SimpleFillSymbol x:Key="PolygonSelectSymbol" Fill="#66BB0000" BorderBrush="#88CC0000" BorderThickness="2"  />

Any code snippet will be good
Please find the attached screen shot along with.