dymaptic.GeoBlazor.Core

dymaptic.GeoBlazor.Core.Components.Widgets

LegendWidget Class

<a target=”_blank” href=”https://docs.geoblazor.com/pages/classes/dymaptic.GeoBlazor.Core.Components.Widgets.LegendWidget.html”>GeoBlazor Docs</a> The Legend widget describes the symbols used to represent layers in a map. <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html”>ArcGIS Maps SDK for JavaScript</a>

public class LegendWidget : dymaptic.GeoBlazor.Core.Components.Widgets.Widget

Inheritance System.Object 🡒 Microsoft.AspNetCore.Components.ComponentBase 🡒 MapComponent 🡒 Widget 🡒 LegendWidget

Constructors

LegendWidget() Constructor

Parameterless constructor for use as a Razor Component.

public LegendWidget();

LegendWidget(IReadOnlyList<ActiveLayerInfo>, Nullable<bool>, string, Nullable<double>, Nullable<bool>, string, string, IReadOnlyList<LegendLayerInfos>, LegendStyle, MapView, Nullable<OverlayPosition>, Nullable<bool>, Nullable<bool>, string, LegendViewModel, Nullable<bool>, string) Constructor

Constructor for use in C# code. Use named parameters (e.g., item1: value1, item2: value2) to set properties in any order.

public LegendWidget(System.Collections.Generic.IReadOnlyList<dymaptic.GeoBlazor.Core.Components.ActiveLayerInfo>? activeLayerInfos=null, System.Nullable<bool> basemapLegendVisible=null, string? containerId=null, System.Nullable<double> headingLevel=null, System.Nullable<bool> hideLayersNotInCurrentView=null, string? icon=null, string? label=null, System.Collections.Generic.IReadOnlyList<dymaptic.GeoBlazor.Core.Components.LegendLayerInfos>? layerInfos=null, dymaptic.GeoBlazor.Core.Components.LegendStyle? legendStyle=null, dymaptic.GeoBlazor.Core.Components.Views.MapView? mapView=null, System.Nullable<dymaptic.GeoBlazor.Core.Enums.OverlayPosition> position=null, System.Nullable<bool> respectLayerDefinitionExpression=null, System.Nullable<bool> respectLayerVisibility=null, string? stringStyle=null, dymaptic.GeoBlazor.Core.Components.LegendViewModel? viewModel=null, System.Nullable<bool> visible=null, string? widgetId=null);

Parameters

activeLayerInfos System.Collections.Generic.IReadOnlyList<ActiveLayerInfo>

Collection of <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html”>ActiveLayerInfo</a> objects used by the legend view to display data in the legend. <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#activeLayerInfos”>ArcGIS Maps SDK for JavaScript</a>

basemapLegendVisible System.Nullable<System.Boolean>

Indicates whether to show the <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html”>Basemap</a> layers in the Legend. default false <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#basemapLegendVisible”>ArcGIS Maps SDK for JavaScript</a>

containerId System.String

The id of an external HTML Element (div). If provided, the widget will be placed inside that element, instead of on the map.

headingLevel System.Nullable<System.Double>

Indicates the heading level to use for the legend title. default 3 <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#headingLevel”>ArcGIS Maps SDK for JavaScript</a>

hideLayersNotInCurrentView System.Nullable<System.Boolean>

When `true`, layers will only be shown in the legend if they are visible in the view’s extent. default false <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#hideLayersNotInCurrentView”>ArcGIS Maps SDK for JavaScript</a>

icon System.String

Icon which represents the widget. default “legend” <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#icon”>ArcGIS Maps SDK for JavaScript</a>

label System.String

The widget’s default label. <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#label”>ArcGIS Maps SDK for JavaScript</a>

layerInfos System.Collections.Generic.IReadOnlyList<LegendLayerInfos>

Specifies a subset of the layers to display in the legend. <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#layerInfos”>ArcGIS Maps SDK for JavaScript</a>

legendStyle LegendStyle

Indicates the style of the legend. default “classic” <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#style”>ArcGIS Maps SDK for JavaScript</a>

mapView MapView

If the Widget is defined outside of the MapView, this link is required to connect them together.

position System.Nullable<OverlayPosition>

The position of the widget in relation to the map view.

respectLayerDefinitionExpression System.Nullable<System.Boolean>

If a layer uses a unique value render, only features that satisfy the layer’s <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#definitionExpression”>definition expression</a> will be displayed in the legend when set to true. default false <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#respectLayerDefinitionExpression”>ArcGIS Maps SDK for JavaScript</a>

respectLayerVisibility System.Nullable<System.Boolean>

Determines whether to respect the properties of the layers in the map that control the legend’s visibility (`minScale`, `maxScale`, `legendEnabled`). default true <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#respectLayerVisibility”>ArcGIS Maps SDK for JavaScript</a>

stringStyle System.String

Indicates the style of the legend. default “classic” <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#style”>ArcGIS Maps SDK for JavaScript</a>

viewModel LegendViewModel

The view model for this widget. <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#viewModel”>ArcGIS Maps SDK for JavaScript</a>

visible System.Nullable<System.Boolean>

Indicates whether the widget is visible. default true <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#visible”>ArcGIS Maps SDK for JavaScript</a>

widgetId System.String

The unique ID assigned to the widget when the widget is created. <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#id”>ArcGIS Maps SDK for JavaScript</a>

Properties

LegendWidget.ActiveLayerInfos Property

<a target=”_blank” href=”https://docs.geoblazor.com/pages/classes/dymaptic.GeoBlazor.Core.Components.Widgets.LegendWidget.html#legendwidgetactivelayerinfos-property”>GeoBlazor Docs</a> Collection of <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html”>ActiveLayerInfo</a> objects used by the legend view to display data in the legend. <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#activeLayerInfos”>ArcGIS Maps SDK for JavaScript</a>

public System.Collections.Generic.IReadOnlyList<dymaptic.GeoBlazor.Core.Components.ActiveLayerInfo>? ActiveLayerInfos { get; set; }

Property Value

System.Collections.Generic.IReadOnlyList<ActiveLayerInfo>

LegendWidget.BasemapLegendVisible Property

<a target=”_blank” href=”https://docs.geoblazor.com/pages/classes/dymaptic.GeoBlazor.Core.Components.Widgets.LegendWidget.html#legendwidgetbasemaplegendvisible-property”>GeoBlazor Docs</a> Indicates whether to show the <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html”>Basemap</a> layers in the Legend. default false <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#basemapLegendVisible”>ArcGIS Maps SDK for JavaScript</a>

public System.Nullable<bool> BasemapLegendVisible { get; set; }

Property Value

System.Nullable<System.Boolean>

LegendWidget.HeadingLevel Property

<a target=”_blank” href=”https://docs.geoblazor.com/pages/classes/dymaptic.GeoBlazor.Core.Components.Widgets.LegendWidget.html#legendwidgetheadinglevel-property”>GeoBlazor Docs</a> Indicates the heading level to use for the legend title. default 3 <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#headingLevel”>ArcGIS Maps SDK for JavaScript</a>

public System.Nullable<double> HeadingLevel { get; set; }

Property Value

System.Nullable<System.Double>

LegendWidget.HideLayersNotInCurrentView Property

<a target=”_blank” href=”https://docs.geoblazor.com/pages/classes/dymaptic.GeoBlazor.Core.Components.Widgets.LegendWidget.html#legendwidgethidelayersnotincurrentview-property”>GeoBlazor Docs</a> When `true`, layers will only be shown in the legend if they are visible in the view’s extent. default false <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#hideLayersNotInCurrentView”>ArcGIS Maps SDK for JavaScript</a>

public System.Nullable<bool> HideLayersNotInCurrentView { get; set; }

Property Value

System.Nullable<System.Boolean>

LegendWidget.LayerInfos Property

<a target=”_blank” href=”https://docs.geoblazor.com/pages/classes/dymaptic.GeoBlazor.Core.Components.Widgets.LegendWidget.html#legendwidgetlayerinfos-property”>GeoBlazor Docs</a> Specifies a subset of the layers to display in the legend. <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#layerInfos”>ArcGIS Maps SDK for JavaScript</a>

public System.Collections.Generic.IReadOnlyList<dymaptic.GeoBlazor.Core.Components.LegendLayerInfos>? LayerInfos { get; set; }

Property Value

System.Collections.Generic.IReadOnlyList<LegendLayerInfos>

LegendWidget.LegendStyle Property

<a target=”_blank” href=”https://docs.geoblazor.com/pages/classes/dymaptic.GeoBlazor.Core.Components.Widgets.LegendWidget.html#legendwidgetlegendstyle-property”>GeoBlazor Docs</a> Indicates the style of the legend. default “classic” <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#style”>ArcGIS Maps SDK for JavaScript</a>

public dymaptic.GeoBlazor.Core.Components.LegendStyle? LegendStyle { get; set; }

Property Value

LegendStyle

LegendWidget.RespectLayerDefinitionExpression Property

<a target=”_blank” href=”https://docs.geoblazor.com/pages/classes/dymaptic.GeoBlazor.Core.Components.Widgets.LegendWidget.html#legendwidgetrespectlayerdefinitionexpression-property”>GeoBlazor Docs</a> If a layer uses a unique value render, only features that satisfy the layer’s <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#definitionExpression”>definition expression</a> will be displayed in the legend when set to true. default false <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#respectLayerDefinitionExpression”>ArcGIS Maps SDK for JavaScript</a>

public System.Nullable<bool> RespectLayerDefinitionExpression { get; set; }

Property Value

System.Nullable<System.Boolean>

LegendWidget.RespectLayerVisibility Property

<a target=”_blank” href=”https://docs.geoblazor.com/pages/classes/dymaptic.GeoBlazor.Core.Components.Widgets.LegendWidget.html#legendwidgetrespectlayervisibility-property”>GeoBlazor Docs</a> Determines whether to respect the properties of the layers in the map that control the legend’s visibility (`minScale`, `maxScale`, `legendEnabled`). default true <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#respectLayerVisibility”>ArcGIS Maps SDK for JavaScript</a>

public System.Nullable<bool> RespectLayerVisibility { get; set; }

Property Value

System.Nullable<System.Boolean>

LegendWidget.StringStyle Property

<a target=”_blank” href=”https://docs.geoblazor.com/pages/classes/dymaptic.GeoBlazor.Core.Components.Widgets.LegendWidget.html#legendwidgetstringstyle-property”>GeoBlazor Docs</a> Indicates the style of the legend. default “classic” <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#style”>ArcGIS Maps SDK for JavaScript</a>

public string? StringStyle { get; set; }

Property Value

System.String

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. <a target=”_blank” href=” https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#style”>ArcGIS Maps SDK for JavaScript</a>

public dymaptic.GeoBlazor.Core.Components.LegendStyle? Style { get; set; }

Property Value

LegendStyle

LegendWidget.Type Property

The type of widget

public override dymaptic.GeoBlazor.Core.Enums.WidgetType Type { get; }

Property Value

WidgetType

LegendWidget.ViewModel Property

<a target=”_blank” href=”https://docs.geoblazor.com/pages/classes/dymaptic.GeoBlazor.Core.Components.Widgets.LegendWidget.html#legendwidgetviewmodel-property”>GeoBlazor Docs</a> The view model for this widget. <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#viewModel”>ArcGIS Maps SDK for JavaScript</a>

public dymaptic.GeoBlazor.Core.Components.LegendViewModel? ViewModel { get; set; }

Property Value

LegendViewModel

Methods

LegendWidget.AddToActiveLayerInfos(ActiveLayerInfo[]) Method

Asynchronously adds elements to the ActiveLayerInfos property.

public System.Threading.Tasks.Task AddToActiveLayerInfos(params dymaptic.GeoBlazor.Core.Components.ActiveLayerInfo[] values);

Parameters

values ActiveLayerInfo[]

The elements to add.

Returns

System.Threading.Tasks.Task

LegendWidget.AddToLayerInfos(LegendLayerInfos[]) Method

Asynchronously adds elements to the LayerInfos property.

public System.Threading.Tasks.Task AddToLayerInfos(params dymaptic.GeoBlazor.Core.Components.LegendLayerInfos[] values);

Parameters

values LegendLayerInfos[]

The elements to add.

Returns

System.Threading.Tasks.Task

LegendWidget.GetActiveLayerInfos() Method

Asynchronously retrieve the current value of the ActiveLayerInfos property.

public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<dymaptic.GeoBlazor.Core.Components.ActiveLayerInfo>?> GetActiveLayerInfos();

Returns

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<ActiveLayerInfo>>

LegendWidget.GetBasemapLegendVisible() Method

Asynchronously retrieve the current value of the BasemapLegendVisible property.

public System.Threading.Tasks.Task<System.Nullable<bool>> GetBasemapLegendVisible();

Returns

System.Threading.Tasks.Task<System.Nullable<System.Boolean>>

LegendWidget.GetHeadingLevel() Method

Asynchronously retrieve the current value of the HeadingLevel property.

public System.Threading.Tasks.Task<System.Nullable<double>> GetHeadingLevel();

Returns

System.Threading.Tasks.Task<System.Nullable<System.Double>>

LegendWidget.GetHideLayersNotInCurrentView() Method

Asynchronously retrieve the current value of the HideLayersNotInCurrentView property.

public System.Threading.Tasks.Task<System.Nullable<bool>> GetHideLayersNotInCurrentView();

Returns

System.Threading.Tasks.Task<System.Nullable<System.Boolean>>

LegendWidget.GetLayerInfos() Method

Asynchronously retrieve the current value of the LayerInfos property.

public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<dymaptic.GeoBlazor.Core.Components.LegendLayerInfos>?> GetLayerInfos();

Returns

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<LegendLayerInfos>>

LegendWidget.GetLegendStyle() Method

Asynchronously retrieve the current value of the LegendStyle property.

public System.Threading.Tasks.Task<dymaptic.GeoBlazor.Core.Components.LegendStyle?> GetLegendStyle();

Returns

System.Threading.Tasks.Task<LegendStyle>

LegendWidget.GetRespectLayerDefinitionExpression() Method

Asynchronously retrieve the current value of the RespectLayerDefinitionExpression property.

public System.Threading.Tasks.Task<System.Nullable<bool>> GetRespectLayerDefinitionExpression();

Returns

System.Threading.Tasks.Task<System.Nullable<System.Boolean>>

LegendWidget.GetRespectLayerVisibility() Method

Asynchronously retrieve the current value of the RespectLayerVisibility property.

public System.Threading.Tasks.Task<System.Nullable<bool>> GetRespectLayerVisibility();

Returns

System.Threading.Tasks.Task<System.Nullable<System.Boolean>>

LegendWidget.GetStringStyle() Method

Asynchronously retrieve the current value of the StringStyle property.

public System.Threading.Tasks.Task<string?> GetStringStyle();

Returns

System.Threading.Tasks.Task<System.String>

LegendWidget.GetViewModel() Method

Asynchronously retrieve the current value of the ViewModel property.

public System.Threading.Tasks.Task<dymaptic.GeoBlazor.Core.Components.LegendViewModel?> GetViewModel();

Returns

System.Threading.Tasks.Task<LegendViewModel>

LegendWidget.RegisterChildComponent(MapComponent) Method

Called from dymaptic.GeoBlazor.Core.Components.MapComponent.OnInitializedAsync to “Register” the current component with its parent.

public override System.Threading.Tasks.Task RegisterChildComponent(dymaptic.GeoBlazor.Core.Components.MapComponent child);

Parameters

child MapComponent

The calling, child component to register

Returns

System.Threading.Tasks.Task

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.RemoveFromActiveLayerInfos(ActiveLayerInfo[]) Method

Asynchronously remove an element from the ActiveLayerInfos property.

public System.Threading.Tasks.Task RemoveFromActiveLayerInfos(params dymaptic.GeoBlazor.Core.Components.ActiveLayerInfo[] values);

Parameters

values ActiveLayerInfo[]

The elements to remove.

Returns

System.Threading.Tasks.Task

LegendWidget.RemoveFromLayerInfos(LegendLayerInfos[]) Method

Asynchronously remove an element from the LayerInfos property.

public System.Threading.Tasks.Task RemoveFromLayerInfos(params dymaptic.GeoBlazor.Core.Components.LegendLayerInfos[] values);

Parameters

values LegendLayerInfos[]

The elements to remove.

Returns

System.Threading.Tasks.Task

LegendWidget.SetActiveLayerInfos(IReadOnlyList<ActiveLayerInfo>) Method

Asynchronously set the value of the ActiveLayerInfos property after render.

public System.Threading.Tasks.Task SetActiveLayerInfos(System.Collections.Generic.IReadOnlyList<dymaptic.GeoBlazor.Core.Components.ActiveLayerInfo>? value);

Parameters

value System.Collections.Generic.IReadOnlyList<ActiveLayerInfo>

The value to set.

Returns

System.Threading.Tasks.Task

LegendWidget.SetBasemapLegendVisible(Nullable<bool>) Method

Asynchronously set the value of the BasemapLegendVisible property after render.

public System.Threading.Tasks.Task SetBasemapLegendVisible(System.Nullable<bool> value);

Parameters

value System.Nullable<System.Boolean>

The value to set.

Returns

System.Threading.Tasks.Task

LegendWidget.SetHeadingLevel(Nullable<double>) Method

Asynchronously set the value of the HeadingLevel property after render.

public System.Threading.Tasks.Task SetHeadingLevel(System.Nullable<double> value);

Parameters

value System.Nullable<System.Double>

The value to set.

Returns

System.Threading.Tasks.Task

LegendWidget.SetHideLayersNotInCurrentView(Nullable<bool>) Method

Asynchronously set the value of the HideLayersNotInCurrentView property after render.

public System.Threading.Tasks.Task SetHideLayersNotInCurrentView(System.Nullable<bool> value);

Parameters

value System.Nullable<System.Boolean>

The value to set.

Returns

System.Threading.Tasks.Task

LegendWidget.SetLayerInfos(IReadOnlyList<LegendLayerInfos>) Method

Asynchronously set the value of the LayerInfos property after render.

public System.Threading.Tasks.Task SetLayerInfos(System.Collections.Generic.IReadOnlyList<dymaptic.GeoBlazor.Core.Components.LegendLayerInfos>? value);

Parameters

value System.Collections.Generic.IReadOnlyList<LegendLayerInfos>

The value to set.

Returns

System.Threading.Tasks.Task

LegendWidget.SetLegendStyle(LegendStyle) Method

Asynchronously set the value of the LegendStyle property after render.

public System.Threading.Tasks.Task SetLegendStyle(dymaptic.GeoBlazor.Core.Components.LegendStyle? value);

Parameters

value LegendStyle

The value to set.

Returns

System.Threading.Tasks.Task

LegendWidget.SetRespectLayerDefinitionExpression(Nullable<bool>) Method

Asynchronously set the value of the RespectLayerDefinitionExpression property after render.

public System.Threading.Tasks.Task SetRespectLayerDefinitionExpression(System.Nullable<bool> value);

Parameters

value System.Nullable<System.Boolean>

The value to set.

Returns

System.Threading.Tasks.Task

LegendWidget.SetRespectLayerVisibility(Nullable<bool>) Method

Asynchronously set the value of the RespectLayerVisibility property after render.

public System.Threading.Tasks.Task SetRespectLayerVisibility(System.Nullable<bool> value);

Parameters

value System.Nullable<System.Boolean>

The value to set.

Returns

System.Threading.Tasks.Task

LegendWidget.SetStringStyle(string) Method

Asynchronously set the value of the StringStyle property after render.

public System.Threading.Tasks.Task SetStringStyle(string? value);

Parameters

value System.String

The value to set.

Returns

System.Threading.Tasks.Task

LegendWidget.SetViewModel(LegendViewModel) Method

Asynchronously set the value of the ViewModel property after render.

public System.Threading.Tasks.Task SetViewModel(dymaptic.GeoBlazor.Core.Components.LegendViewModel? value);

Parameters

value LegendViewModel

The value to set.

Returns

System.Threading.Tasks.Task

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

System.Threading.Tasks.Task

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.

LegendWidget.ValidateRequiredGeneratedChildren() Method

Validates source-generated child components.

public override void ValidateRequiredGeneratedChildren();

Implements ValidateRequiredGeneratedChildren()