dymaptic.GeoBlazor.Core

dymaptic.GeoBlazor.Core.Components.Widgets

LegendWidget Class

The Legend widget describes the symbols used to represent layers in a map.
ArcGIS Maps SDK for JavaScript

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, Nullable, string, Nullable, Nullable, string, string, IReadOnlyList, LegendStyle, MapView, Nullable, Nullable, Nullable, string, LegendViewModel, Nullable, 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 ActiveLayerInfo objects used by the legend view to
display data in the legend.
ArcGIS Maps SDK for JavaScript

basemapLegendVisible System.Nullable<System.Boolean>

Indicates whether to show the Basemap layers in the Legend.
default false
ArcGIS Maps SDK for JavaScript

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
ArcGIS Maps SDK for JavaScript

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
ArcGIS Maps SDK for JavaScript

icon System.String

Icon which represents the widget.
default “legend”
ArcGIS Maps SDK for JavaScript

label System.String

The widget’s default label.
ArcGIS Maps SDK for JavaScript

layerInfos System.Collections.Generic.IReadOnlyList<LegendLayerInfos>

Specifies a subset of the layers to display in the legend.
ArcGIS Maps SDK for JavaScript

legendStyle LegendStyle

Indicates the style of the legend.
default “classic”
ArcGIS Maps SDK for JavaScript

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
definition expression
will be displayed in the legend when set to true.
default false
ArcGIS Maps SDK for JavaScript

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
ArcGIS Maps SDK for JavaScript

stringStyle System.String

Indicates the style of the legend.
default “classic”
ArcGIS Maps SDK for JavaScript

viewModel LegendViewModel

The view model for this widget.
ArcGIS Maps SDK for JavaScript

visible System.Nullable<System.Boolean>

Indicates whether the widget is visible.
default true
ArcGIS Maps SDK for JavaScript

widgetId System.String

The unique ID assigned to the widget when the widget is created.
ArcGIS Maps SDK for JavaScript

Properties

LegendWidget.ActiveLayerInfos Property

Collection of ActiveLayerInfo objects used by the legend view to
display data in the legend.
ArcGIS Maps SDK for JavaScript

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

Property Value

System.Collections.Generic.IReadOnlyList<ActiveLayerInfo>

LegendWidget.BasemapLegendVisible Property

Indicates whether to show the Basemap layers in the Legend.
default false
ArcGIS Maps SDK for JavaScript

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

Property Value

System.Nullable<System.Boolean>

LegendWidget.HeadingLevel Property

Indicates the heading level to use for the legend title.
default 3
ArcGIS Maps SDK for JavaScript

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

Property Value

System.Nullable<System.Double>

LegendWidget.HideLayersNotInCurrentView Property

When true, layers will only be shown in the legend if
they are visible in the view’s extent.
default false
ArcGIS Maps SDK for JavaScript

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

Property Value

System.Nullable<System.Boolean>

LegendWidget.LayerInfos Property

Specifies a subset of the layers to display in the legend.
ArcGIS Maps SDK for JavaScript

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

Property Value

System.Collections.Generic.IReadOnlyList<LegendLayerInfos>

LegendWidget.LegendStyle Property

Indicates the style of the legend.
default “classic”
ArcGIS Maps SDK for JavaScript

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

Property Value

LegendStyle

LegendWidget.RespectLayerDefinitionExpression Property

If a layer uses a unique value render, only features that satisfy the layer’s
definition expression
will be displayed in the legend when set to true.
default false
ArcGIS Maps SDK for JavaScript

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

Property Value

System.Nullable<System.Boolean>

LegendWidget.RespectLayerVisibility Property

Determines whether to respect the properties of the layers in the map that
control the legend’s visibility (minScale, maxScale, legendEnabled).
default true
ArcGIS Maps SDK for JavaScript

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

Property Value

System.Nullable<System.Boolean>

LegendWidget.StringStyle Property

Indicates the style of the legend.
default “classic”
ArcGIS Maps SDK for JavaScript

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.
ArcGIS Maps SDK for JavaScript

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

The view model for this widget.
ArcGIS Maps SDK for JavaScript

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) 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) 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) 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) 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) 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) 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) 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()