Hi,
I have this code line:
void AddPolygonGraphicsReport(string Coodinates)
{
GraphicsLayer PolygonGraphicsLayer = Mimapa.Layers["MyGraphicsLayer"] as GraphicsLayer;
PointCollectionConverter pointConverter = new PointCollectionConverter();
FillSymbol iFillSymbol = new FillSymbol
{
BorderBrush = new SolidColorBrush(Color.FromArgb(0, 255, 0, 0)),
BorderThickness = 2,
Fill = new SolidColorBrush(Color.FromArgb(0, 255, 0, 0))
};
ESRI.ArcGIS.Client.Geometry.PointCollection PointCollectionReport =
pointConverter.ConvertFromString(Coodinates) as ESRI.ArcGIS.Client.Geometry.PointCollection;
ESRI.ArcGIS.Client.Geometry.Polygon PolygonReport = new ESRI.ArcGIS.Client.Geometry.Polygon();
PolygonReport.Rings.Add(PointCollectionReport);
Graphic GraphicPolygon = new Graphic()
{
Geometry = PolygonReport,
Symbol = iFillSymbol
};
PolygonGraphicsLayer.Graphics.Add(GraphicPolygon);
}
But Silverlight can't show the type BorderBrush, BorderThickness and fill. Only obtain proporeties when write xaml:
<esri:SimpleLineSymbol x:Key="DefaultLineSymbol" Color="Green" Style="DashDot" Width="4" />
A same problem with SimpleLine:
SimpleLineSymbol iSimpleLineSymbol = new SimpleLineSymbol
{
Width = size,
Color = new SolidColorBrush(SLGeoviewerClassLibrary.Model.Common.ArrayToColor(color)),
Style = SLGeoviewerClassLibrary.Model.Common.sSimpleLineStyle(Convert.ToByte(style))
};
GraphicsLayer LineStringsGraphicsLayer = Mimapa.Layers["MyGraphicsLayer"] as GraphicsLayer;
List<ESRI.ArcGIS.Client.Geometry.Polyline> polylineList = new List<ESRI.ArcGIS.Client.Geometry.Polyline>();
ESRI.ArcGIS.Client.Geometry.PointCollection pointCollection = new ESRI.ArcGIS.Client.Geometry.PointCollection();
for (int i = 1; i < lsc.Length; i++)
{
string[] Coords = null;
Coords = lsc.Split(' ');
pointCollection.Add(new MapPoint(Convert.ToDouble(Coords[1], System.Globalization.CultureInfo.InvariantCulture),
Convert.ToDouble(Coords[2], System.Globalization.CultureInfo.InvariantCulture)));
}
ESRI.ArcGIS.Client.Geometry.Polyline polyline = new ESRI.ArcGIS.Client.Geometry.Polyline();
polyline.Paths.Add(pointCollection);
Graphic GraphicLineStrings = new Graphic();
GraphicLineStrings.Geometry = polyline;
GraphicLineStrings.Symbol = LayoutRoot.Resources["DefaultLineSymbol"] as Symbol;
LineStringsGraphicsLayer.Graphics.Add(GraphicLineStrings);
Please help me.
Thanks