Hi, I'm new to ArcGIS and I'm trying to make use of the legend control from Esri.ArcGISRuntime.Toolkit.WPF, 200.8.0. The map shows the symbols as expected, but the legend only shows the names of the layer and not the symbols. I have 21 symbols defined in the ORDERS style, and 31 symbols defined for the USERS style.
XAML for the map and legend:
<esri:MapView x:Name="MainMapView"
Grid.Row="1"
Map="{Binding Map, Source={StaticResource MapViewModel}}"
GraphicsOverlays="{Binding GraphicsOverlays, Source={StaticResource MapViewModel}}" >
</esri:MapView>
<esri:Legend x:Name="MainLegend" Grid.Row="1" GeoView="{Binding ElementName=MainMapView}" VerticalAlignment="Bottom" HorizontalAlignment="Right" Visibility="Visible"/>
Code creating the feature layer:
_geodatabase = await Geodatabase.OpenAsync(mobileGdbPathName);
foreach (var table in _geodatabase.GeodatabaseFeatureTables)
{
if (table.TableName.Equals(MY_FEATURE_LAYER_NAME))
{
await table.LoadAsync();
_myFeatureLayer = new FeatureLayer(table);
DictionarySymbolStyle myLocalStyle =
await DictionarySymbolStyle.CreateFromFileAsync(myStylxPath);
_myFeatureLayer.Renderer = new DictionaryRenderer(myLocalStyle);
this.Map.OperationalLayers.Add(_myFeatureLayer);
}
}
In case you are confused by the "WinFormMapCtrl" title, this is just a WinForm hosting the WPF map control.
Any help would be much appreciated.
Michael
If I'm not mistaken, Legend isn't supported for a DictionaryRenderer. Try calling _myFeatureLayer.GetLegendInfosAsync() and see if it returns anything.