Hi,
I am creating a FeatureLayer from a Shapefile on my map with the following code at application startup :
public async void LoadShapefileAsync(string path)
{
try
{
ShapefileTable shapefile = await ShapefileTable.OpenAsync(path);
_spatialReference = shapefile.SpatialReference;
GisMap.SpatialReference = _spatialReference;
FeatureLayer flayer = new FeatureLayer(shapefile)
{
ID = shapefile.Name,
DisplayName = path,
};
GisMap.Layers.Add(flayer);
}
catch (Exception ex)
{
throw new ArgumentException("Feature-Layer aus Shapedatei konnte nicht erstellt werden: " + ex.Message);
}
}
The result on my map is a grey filled polygon with a black solid outline.
How can I change the fill color and outline style for the polygon(s) on the FeatureLayer?
Thanks in advance! 🙂
Solved! Go to Solution.
The Shapefile layer will render with this default renderer. You can assign your own renderer to it, either Simple-, Unique- or ClassBreaksRenderer. Example
flayer.Renderer = new SimpleRenderer() { Symbol = new SimpleFillSymbol() { Color = Colors. Red } };
The Shapefile layer will render with this default renderer. You can assign your own renderer to it, either Simple-, Unique- or ClassBreaksRenderer. Example
flayer.Renderer = new SimpleRenderer() { Symbol = new SimpleFillSymbol() { Color = Colors. Red } };
Works like a charm!
Many thanks