dymaptic.GeoBlazor.Core

dymaptic.GeoBlazor.Core.Components.Widgets

BasemapToggleWidget Class

The BasemapToggle provides a widget which allows an end-user to switch between
two basemaps.
ArcGIS Maps SDK for JavaScript

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

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

Constructors

BasemapToggleWidget() Constructor

Parameterless constructor for use as a Razor Component.

public BasemapToggleWidget();

BasemapToggleWidget(string, string, string, MapView, Basemap, Nullable, BasemapToggleViewModel, Nullable, BasemapToggleVisibleElements, string) Constructor

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

public BasemapToggleWidget(string? containerId=null, string? icon=null, string? label=null, dymaptic.GeoBlazor.Core.Components.Views.MapView? mapView=null, dymaptic.GeoBlazor.Core.Components.Basemap? nextBasemap=null, System.Nullable<dymaptic.GeoBlazor.Core.Enums.OverlayPosition> position=null, dymaptic.GeoBlazor.Core.Components.BasemapToggleViewModel? viewModel=null, System.Nullable<bool> visible=null, dymaptic.GeoBlazor.Core.Components.BasemapToggleVisibleElements? visibleElements=null, string? widgetId=null);

Parameters

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.

icon System.String

Icon which represents the widget.
default “layer-basemap”
ArcGIS Maps SDK for JavaScript

label System.String

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

mapView MapView

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

nextBasemap Basemap

The next basemap for toggling.
ArcGIS Maps SDK for JavaScript

position System.Nullable<OverlayPosition>

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

viewModel BasemapToggleViewModel

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

visibleElements BasemapToggleVisibleElements

The visible elements that are displayed within the widget.
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

BasemapToggleWidget.ActiveBasemap Property

The map’s basemap.
ArcGIS Maps SDK for JavaScript

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

Property Value

Basemap

BasemapToggleWidget.NextBasemap Property

The next basemap for toggling.
ArcGIS Maps SDK for JavaScript

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

Property Value

Basemap

BasemapToggleWidget.NextBasemapName Property

The name of the next basemap for toggling.

public string? NextBasemapName { get; set; }

Property Value

System.String

Remarks

Set either NextBasemapName or NextBasemap

BasemapToggleWidget.NextBasemapStyle Property

The next BasemapStyleName for toggling.

public System.Nullable<dymaptic.GeoBlazor.Core.Enums.BasemapStyleName> NextBasemapStyle { get; set; }

Property Value

System.Nullable<BasemapStyleName>

BasemapToggleWidget.Type Property

The type of widget

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

Property Value

WidgetType

BasemapToggleWidget.ViewModel Property

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

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

Property Value

BasemapToggleViewModel

BasemapToggleWidget.VisibleElements Property

The visible elements that are displayed within the widget.
ArcGIS Maps SDK for JavaScript

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

Property Value

BasemapToggleVisibleElements

Methods

BasemapToggleWidget.GetActiveBasemap() Method

Asynchronously retrieve the current value of the ActiveBasemap property.

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

Returns

System.Threading.Tasks.Task<Basemap>

BasemapToggleWidget.GetViewModel() Method

Asynchronously retrieve the current value of the ViewModel property.

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

Returns

System.Threading.Tasks.Task<BasemapToggleViewModel>

BasemapToggleWidget.GetVisibleElements() Method

Asynchronously retrieve the current value of the VisibleElements property.

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

Returns

System.Threading.Tasks.Task<BasemapToggleVisibleElements>

BasemapToggleWidget.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.

BasemapToggleWidget.SetViewModel(BasemapToggleViewModel) Method

Asynchronously set the value of the ViewModel property after render.

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

Parameters

value BasemapToggleViewModel

The value to set.

Returns

System.Threading.Tasks.Task

BasemapToggleWidget.SetVisibleElements(BasemapToggleVisibleElements) Method

Asynchronously set the value of the VisibleElements property after render.

public System.Threading.Tasks.Task SetVisibleElements(dymaptic.GeoBlazor.Core.Components.BasemapToggleVisibleElements? value);

Parameters

value BasemapToggleVisibleElements

The value to set.

Returns

System.Threading.Tasks.Task

BasemapToggleWidget.Toggle() Method

Toggles to the next basemap.
ArcGIS Maps SDK for JavaScript

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

Returns

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

BasemapToggleWidget.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.

BasemapToggleWidget.ValidateRequiredChildren() Method

When a MapView is prepared to render, this will check to make sure that all properties with the RequiredPropertyAttribute are provided.

public override void ValidateRequiredChildren();

Implements ValidateRequiredChildren()

Exceptions

MissingRequiredChildElementException
The consumer needs to provide the missing child component

MissingRequiredOptionsChildElementException
The consumer needs to provide ONE of the options of child components

BasemapToggleWidget.ValidateRequiredGeneratedChildren() Method

Validates source-generated child components.

public override void ValidateRequiredGeneratedChildren();

Implements ValidateRequiredGeneratedChildren()