Getting feature geometry type in arcgis silverlight api 2.0

519
1
12-20-2010 08:59 PM
rohandontireddy
New Contributor
Hi i have recently converted my code to arcgis silverlight api 2.0 and im using arcgis 10 version, my problem is in selection and buffer tools for result featureset geometry is coming as Envelope.
and for feature the geometry type is null

Previously in arcgis 9.3 im using the below code to highlight the features

foreach (Graphic feature in featureset.Features)
{
feature.Symbol = resultsFillSymbol;
graphicslayer.Graphics.Insert(0, feature);

//if (feature.Geometry.GetType().FullName == "ESRI.ArcGIS.Client.Geometry.MapPoint")
//{
// feature.Symbol = SelectionMarkerSymbol;
//}
//if (feature.Geometry.GetType().FullName == "ESRI.ArcGIS.Client.Geometry.Polyline")
//{
// feature.Symbol = SelectLineSymbol;
//}
//if (feature.Geometry.GetType().FullName == "ESRI.ArcGIS.Client.Geometry.Polygon")
//{
// feature.Symbol = resultsFillSymbol;
//}
//graphicslayer.Graphics.Add(feature);

}

How to acheive the same in silverlight api 2.0
0 Kudos
1 Reply
AliMirzabeigi
New Contributor
You can achieve this by doing the following:
if (feature.Geometry is ESRI.ArcGIS.Client.Geometry.MapPoint)
{
      feature.Symbol = SelectionMarkerSymbol;
}
.....
0 Kudos