dymaptic.GeoBlazor.Core
dymaptic.GeoBlazor.Core.Components
LegendViewModel Class
Provides the logic for the Legend widget,
which displays a label and symbol for interpreting the Renderer
of each layer in a map.
ArcGIS Maps SDK for JavaScript
public class LegendViewModel : dymaptic.GeoBlazor.Core.Components.MapComponent
Inheritance System.Object 🡒 Microsoft.AspNetCore.Components.ComponentBase 🡒 MapComponent 🡒 LegendViewModel
Constructors
LegendViewModel() Constructor
Parameterless constructor for use as a Razor Component.
public LegendViewModel();
LegendViewModel(IReadOnlyList, Nullable, Nullable, IReadOnlyList, Nullable) Constructor
Constructor for use in C# code. Use named parameters (e.g., item1: value1, item2: value2) to set properties in any order.
public LegendViewModel(System.Collections.Generic.IReadOnlyList<dymaptic.GeoBlazor.Core.Components.ActiveLayerInfo>? activeLayerInfos=null, System.Nullable<bool> basemapLegendVisible=null, System.Nullable<bool> hideLayersNotInCurrentView=null, System.Collections.Generic.IReadOnlyList<dymaptic.GeoBlazor.Core.Components.LegendViewModelLayerInfos>? layerInfos=null, System.Nullable<bool> respectLayerVisibility=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 filterBasemaps
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
layerInfos
System.Collections.Generic.IReadOnlyList<LegendViewModelLayerInfos>
Specifies a subset of the layers in the map to display in the legend.
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
Properties
LegendViewModel.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>
LegendViewModel.BasemapLegendVisible Property
Indicates whether to show the Basemap layers in the Legend.
default filterBasemaps
ArcGIS Maps SDK for JavaScript
public System.Nullable<bool> BasemapLegendVisible { get; set; }
Property Value
System.Nullable<System.Boolean>
LegendViewModel.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>
LegendViewModel.LayerInfos Property
Specifies a subset of the layers in the map to display in the legend.
ArcGIS Maps SDK for JavaScript
public System.Collections.Generic.IReadOnlyList<dymaptic.GeoBlazor.Core.Components.LegendViewModelLayerInfos>? LayerInfos { get; set; }
Property Value
System.Collections.Generic.IReadOnlyList<LegendViewModelLayerInfos>
LegendViewModel.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>
LegendViewModel.State Property
The view model’s state.
default “disabled”
ArcGIS Maps SDK for JavaScript
public System.Nullable<dymaptic.GeoBlazor.Core.Enums.LegendViewModelState> State { get; set; }
Property Value
System.Nullable<LegendViewModelState>
Methods
LegendViewModel.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
LegendViewModel.AddToLayerInfos(LegendViewModelLayerInfos[]) Method
Asynchronously adds elements to the LayerInfos property.
public System.Threading.Tasks.Task AddToLayerInfos(params dymaptic.GeoBlazor.Core.Components.LegendViewModelLayerInfos[] values);
Parameters
values
LegendViewModelLayerInfos[]
The elements to add.
Returns
LegendViewModel.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>>
LegendViewModel.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>>
LegendViewModel.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>>
LegendViewModel.GetLayerInfos() Method
Asynchronously retrieve the current value of the LayerInfos property.
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<dymaptic.GeoBlazor.Core.Components.LegendViewModelLayerInfos>?> GetLayerInfos();
Returns
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<LegendViewModelLayerInfos>>
LegendViewModel.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>>
LegendViewModel.GetState() Method
Asynchronously retrieve the current value of the State property.
public System.Threading.Tasks.Task<System.Nullable<dymaptic.GeoBlazor.Core.Enums.LegendViewModelState>> GetState();
Returns
System.Threading.Tasks.Task<System.Nullable<LegendViewModelState>>
LegendViewModel.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
LegendViewModel.RemoveFromLayerInfos(LegendViewModelLayerInfos[]) Method
Asynchronously remove an element from the LayerInfos property.
public System.Threading.Tasks.Task RemoveFromLayerInfos(params dymaptic.GeoBlazor.Core.Components.LegendViewModelLayerInfos[] values);
Parameters
values
LegendViewModelLayerInfos[]
The elements to remove.
Returns
LegendViewModel.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
LegendViewModel.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
LegendViewModel.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
LegendViewModel.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.LegendViewModelLayerInfos>? value);
Parameters
value
System.Collections.Generic.IReadOnlyList<LegendViewModelLayerInfos>
The value to set.
Returns
LegendViewModel.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
LegendViewModel.ValidateRequiredGeneratedChildren() Method
Validates source-generated child components.
public override void ValidateRequiredGeneratedChildren();
Implements ValidateRequiredGeneratedChildren()