Hi,
I am using Esri Silverlight API v2.4.
An application that is working on v2.2, but not working v2.4. The problem is about Esri GraphicsLayer.
private void QueryTask_ExecuteCompleted(object sender, ESRI.ArcGIS.Client.Tasks.QueryEventArgs args)
{
GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer;
graphicsLayer.ClearGraphics();
FeatureSet featureSet = args.FeatureSet;
if (featureSet != null && featureSet.Features.Count > 0)
{
Graphic selectedFeature = featureSet.Features[0];
selectedFeature.Symbol = LayoutRoot.Resources["DefaultFillSymbol"] as Symbol;
graphicsLayer.Graphics.Add(selectedFeature);
ESRI.ArcGIS.Client.Geometry.Envelope selectedFeatureExtent = selectedFeature.Geometry.Extent;
double expandPercentage = 30;
double widthExpand = selectedFeatureExtent.Width * (expandPercentage / 100);
double heightExpand = selectedFeatureExtent.Height * (expandPercentage / 100);
ESRI.ArcGIS.Client.Geometry.Envelope displayExtent = new ESRI.ArcGIS.Client.Geometry.Envelope(
selectedFeatureExtent.XMin - (widthExpand / 2),
selectedFeatureExtent.YMin - (heightExpand / 2),
selectedFeatureExtent.XMax + (widthExpand / 2),
selectedFeatureExtent.YMax + (heightExpand / 2));
MyMap.ZoomTo(displayExtent);
}
}
This code zoom and paint the area of the polygon. Zoom is working fine, but paint is not working.
I have debugged project and selectedFeature.Symbol is not null, everything is normal, but SimpleFillSymbol is not applied. and not appearing on the Map