layout: default title: LegendWidget parent: Core Classes —
dymaptic.GeoBlazor.Core
dymaptic.GeoBlazor.Core.Components.Widgets
LegendWidget Class
The Legend widget describes the symbols used to represent layers in a map. All symbols and text used in this widget
are configured in the Renderer of the layer. The legend will only display layers and sublayers that are visible in
the view.
ArcGIS Maps SDK for JavaScript
public class LegendWidget : dymaptic.GeoBlazor.Core.Components.Widgets.Widget
Inheritance System.Object 🡒 Microsoft.AspNetCore.Components.ComponentBase 🡒 MapComponent 🡒 Widget 🡒 LegendWidget
Properties
LegendWidget.LayerInfos Property
Specifies a subset of the layers to display in the legend. This includes any basemap layers you want to be visible
in the legend. If this property is not set, all layers in the map will display in the legend, including basemap
layers if basemapLegendVisible is true.
public System.Collections.Generic.List<dymaptic.GeoBlazor.Core.Components.Widgets.LayerInfo> LayerInfos { get; set; }
Property Value
System.Collections.Generic.List<LayerInfo>
LegendWidget.Style Property
Indicates the style of the legend. The style determines the legend’s layout and behavior.
You can either specify a string or an object to indicate the style.
The known string values are the same values listed in the table within the type property.
ArcGIS Maps SDK for JavaScript
public dymaptic.GeoBlazor.Core.Components.Widgets.LegendStyle? Style { get; set; }
Property Value
LegendWidget.WidgetType Property
The type of widget
public override string WidgetType { get; }
Property Value
Methods
LegendWidget.RegisterChildComponent(MapComponent) Method
Called from dymaptic.GeoBlazor.Core.Components.MapComponent.OnInitializedAsync to “Register” the current component with it’s parent.
public override System.Threading.Tasks.Task RegisterChildComponent(dymaptic.GeoBlazor.Core.Components.MapComponent child);
Parameters
child
MapComponent
The calling, child component to register
Returns
Exceptions
InvalidChildElementException
Throws if the current child is not a valid sub-component to the parent.
Remarks
This method is an implementation detail and should not be called directly by consumers. In future versions, this may be changed to an internal method. If you see no other way to register a child component, please open an issue on GitHub.
LegendWidget.UnregisterChildComponent(MapComponent) Method
Undoes the “Registration” of a child with its parent.
public override System.Threading.Tasks.Task UnregisterChildComponent(dymaptic.GeoBlazor.Core.Components.MapComponent child);
Parameters
child
MapComponent
The child to unregister
Returns
Remarks
This method is an implementation detail and should not be called directly by consumers. In future versions, this may be changed to an internal method.