dymaptic.GeoBlazor.Core

dymaptic.GeoBlazor.Core.Components.Widgets

LocateWidget Class

Provides a simple widget that animates the View
to the user’s current location.
ArcGIS Maps SDK for JavaScript

public class LocateWidget : dymaptic.GeoBlazor.Core.Components.Widgets.Widget,
dymaptic.GeoBlazor.Core.Interfaces.IGoTo

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

Implements IGoTo

Constructors

LocateWidget() Constructor

Parameterless constructor for use as a Razor Component.

public LocateWidget();

LocateWidget(string, string, Nullable, GoToOverride, Graphic, string, string, MapView, Nullable, Nullable, Nullable, LocateViewModel, 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 LocateWidget(string? containerId=null, string? geolocationOptions=null, System.Nullable<bool> goToLocationEnabled=null, dymaptic.GeoBlazor.Core.Functions.GoToOverride? goToOverride=null, dymaptic.GeoBlazor.Core.Components.Graphic? graphic=null, string? icon=null, string? label=null, dymaptic.GeoBlazor.Core.Components.Views.MapView? mapView=null, System.Nullable<bool> popupEnabled=null, System.Nullable<dymaptic.GeoBlazor.Core.Enums.OverlayPosition> position=null, System.Nullable<int> scale=null, dymaptic.GeoBlazor.Core.Components.LocateViewModel? viewModel=null, System.Nullable<bool> visible=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.

geolocationOptions System.String

The browser’s Geolocation API Position options for locating.
default null
ArcGIS Maps SDK for JavaScript

goToLocationEnabled System.Nullable<System.Boolean>

Indicates whether the widget should navigate the view to the position and scale of the geolocated result.
default true
ArcGIS Maps SDK for JavaScript

goToOverride GoToOverride(GoToOverrideParameters)

This function provides the ability to override either the MapView goTo() or SceneView goTo() methods.
ArcGIS Maps SDK for JavaScript

graphic Graphic

The graphic used to show the user’s location on the map.
ArcGIS Maps SDK for JavaScript

icon System.String

Icon displayed in the widget’s button.
default “compass”
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.

popupEnabled System.Nullable<System.Boolean>

Indicates whether to display the Popup of the result graphic from the
locate() method.
default true
ArcGIS Maps SDK for JavaScript

position System.Nullable<OverlayPosition>

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

scale System.Nullable<System.Int32>

Indicates the scale to set on the view when navigating to the position of the geolocated
result once a location is returned from the track event.
default null
ArcGIS Maps SDK for JavaScript

viewModel LocateViewModel

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

LocateWidget.GeolocationOptions Property

The browser’s Geolocation API Position options for locating.
default null
ArcGIS Maps SDK for JavaScript

public string? GeolocationOptions { get; set; }

Property Value

System.String

LocateWidget.GoToLocationEnabled Property

Indicates whether the widget should navigate the view to the position and scale of the geolocated result.
default true
ArcGIS Maps SDK for JavaScript

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

Property Value

System.Nullable<System.Boolean>

LocateWidget.GoToOverride Property

This function provides the ability to override either the MapView goTo() or SceneView goTo() methods.
ArcGIS Maps SDK for JavaScript

public dymaptic.GeoBlazor.Core.Functions.GoToOverride? GoToOverride { get; set; }

Implements GoToOverride

Property Value

GoToOverride(GoToOverrideParameters)

LocateWidget.Graphic Property

The graphic used to show the user’s location on the map.
ArcGIS Maps SDK for JavaScript

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

Property Value

Graphic

LocateWidget.HasGoToOverride Property

Identifies whether a custom GoToOverride was registered.

public bool HasGoToOverride { get; }

Implements HasGoToOverride

Property Value

System.Boolean

LocateWidget.HasLocateErrorListener Property

Used in JavaScript layer to determine if the event listener is registered.

public bool HasLocateErrorListener { get; }

Property Value

System.Boolean

LocateWidget.HasLocateListener Property

Used in JavaScript layer to determine if the event listener is registered.

public bool HasLocateListener { get; }

Property Value

System.Boolean

LocateWidget.OnLocate Property

Event Listener for Locate.

public Microsoft.AspNetCore.Components.EventCallback<dymaptic.GeoBlazor.Core.Events.LocateEvent> OnLocate { get; set; }

Property Value

Microsoft.AspNetCore.Components.EventCallback<LocateEvent>

LocateWidget.OnLocateError Property

Event Listener for LocateError.

public Microsoft.AspNetCore.Components.EventCallback<dymaptic.GeoBlazor.Core.Events.LocateErrorEvent> OnLocateError { get; set; }

Property Value

Microsoft.AspNetCore.Components.EventCallback<LocateErrorEvent>

LocateWidget.PopupEnabled Property

Indicates whether to display the Popup of the result graphic from the
locate() method.
default true
ArcGIS Maps SDK for JavaScript

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

Property Value

System.Nullable<System.Boolean>

LocateWidget.RotationEnabled Property

Indicates whether the widget will automatically rotate to the device heading based on the Geolocation APIs GeolocationCoordinates.heading property. The map will not rotate if the speed is 0, or if the device is unable to provide heading information.
Set to false to disable this behavior. Default Value:true

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

Property Value

System.Nullable<System.Boolean>

LocateWidget.Scale Property

Indicates the scale to set on the view when navigating to the position of the geolocated result once a location is returned from the track event.

public System.Nullable<int> Scale { get; set; }

Property Value

System.Nullable<System.Int32>

LocateWidget.Type Property

The type of widget

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

Property Value

WidgetType

LocateWidget.ViewModel Property

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

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

Property Value

LocateViewModel

Methods

LocateWidget.CancelLocate() Method

This function provides the ability to interrupt and cancel the process of
programmatically obtaining the location of the user’s device.
ArcGIS Maps SDK for JavaScript

public System.Threading.Tasks.Task CancelLocate();

Returns

System.Threading.Tasks.Task

LocateWidget.GetGeolocationOptions() Method

Asynchronously retrieve the current value of the GeolocationOptions property.

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

Returns

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

LocateWidget.GetGoToLocationEnabled() Method

Asynchronously retrieve the current value of the GoToLocationEnabled property.

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

Returns

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

LocateWidget.GetGraphic() Method

Asynchronously retrieve the current value of the Graphic property.

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

Returns

System.Threading.Tasks.Task<Graphic>

LocateWidget.GetPopupEnabled() Method

Asynchronously retrieve the current value of the PopupEnabled property.

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

Returns

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

LocateWidget.GetScale() Method

Asynchronously retrieve the current value of the Scale property.

public System.Threading.Tasks.Task<System.Nullable<int>> GetScale();

Returns

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

LocateWidget.GetViewModel() Method

Asynchronously retrieve the current value of the ViewModel property.

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

Returns

System.Threading.Tasks.Task<LocateViewModel>

LocateWidget.Locate() Method

Animates the view to the user’s location.
ArcGIS Maps SDK for JavaScript

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

Returns

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

LocateWidget.OnJsGoToOverride(IJSStreamReference) Method

JS-invokable method that triggers the GoToOverride function.
Should not be called by consuming code.

public System.Threading.Tasks.Task OnJsGoToOverride(Microsoft.JSInterop.IJSStreamReference jsStreamRef);

Parameters

jsStreamRef Microsoft.JSInterop.IJSStreamReference

Implements OnJsGoToOverride(IJSStreamReference)

Returns

System.Threading.Tasks.Task

LocateWidget.OnJsLocate(IJSStreamReference) Method

JavaScript-Invokable Method for internal use only.

public System.Threading.Tasks.Task OnJsLocate(Microsoft.JSInterop.IJSStreamReference jsStreamRef);

Parameters

jsStreamRef Microsoft.JSInterop.IJSStreamReference

Returns

System.Threading.Tasks.Task

LocateWidget.OnJsLocateError(IJSStreamReference) Method

JavaScript-Invokable Method for internal use only.

public System.Threading.Tasks.Task OnJsLocateError(Microsoft.JSInterop.IJSStreamReference jsStreamRef);

Parameters

jsStreamRef Microsoft.JSInterop.IJSStreamReference

Returns

System.Threading.Tasks.Task

LocateWidget.SetGeolocationOptions(string) Method

Asynchronously set the value of the GeolocationOptions property after render.

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

Parameters

value System.String

The value to set.

Returns

System.Threading.Tasks.Task

LocateWidget.SetGoToLocationEnabled(Nullable) Method

Asynchronously set the value of the GoToLocationEnabled property after render.

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

Parameters

value System.Nullable<System.Boolean>

The value to set.

Returns

System.Threading.Tasks.Task

LocateWidget.SetGraphic(Graphic) Method

Asynchronously set the value of the Graphic property after render.

public System.Threading.Tasks.Task SetGraphic(dymaptic.GeoBlazor.Core.Components.Graphic? value);

Parameters

value Graphic

The value to set.

Returns

System.Threading.Tasks.Task

LocateWidget.SetPopupEnabled(Nullable) Method

Asynchronously set the value of the PopupEnabled property after render.

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

Parameters

value System.Nullable<System.Boolean>

The value to set.

Returns

System.Threading.Tasks.Task

LocateWidget.SetScale(Nullable) Method

Asynchronously set the value of the Scale property after render.

public System.Threading.Tasks.Task SetScale(System.Nullable<int> value);

Parameters

value System.Nullable<System.Int32>

The value to set.

Returns

System.Threading.Tasks.Task

LocateWidget.SetViewModel(LocateViewModel) Method

Asynchronously set the value of the ViewModel property after render.

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

Parameters

value LocateViewModel

The value to set.

Returns

System.Threading.Tasks.Task

LocateWidget.ValidateRequiredGeneratedChildren() Method

Validates source-generated child components.

public override void ValidateRequiredGeneratedChildren();

Implements ValidateRequiredGeneratedChildren()