GeoBlazor Pro
dymaptic.GeoBlazor.Pro
dymaptic.GeoBlazor.Pro.Components.Widgets
TrackWidget Class
Provides a simple button that animates the View
to the user’s location when clicked.
ArcGIS Maps SDK for JavaScript
public class TrackWidget : dymaptic.GeoBlazor.Pro.Components.Widgets.ProWidget,
dymaptic.GeoBlazor.Core.Interfaces.IGoTo
Inheritance System.Object 🡒 Microsoft.AspNetCore.Components.ComponentBase 🡒 dymaptic.GeoBlazor.Core.Components.MapComponent 🡒 dymaptic.GeoBlazor.Core.Components.Widgets.Widget 🡒 ProWidget 🡒 TrackWidget
Implements dymaptic.GeoBlazor.Core.Interfaces.IGoTo
Constructors
TrackWidget() Constructor
Parameterless constructor for use as a Razor Component.
public TrackWidget();
TrackWidget(string, GeoLocationOptions, Nullable, GoToOverride, Graphic, string, string, MapView, Nullable, Nullable, Nullable, TrackViewModel, 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 TrackWidget(string? containerId=null, dymaptic.GeoBlazor.Core.Options.GeoLocationOptions? 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<dymaptic.GeoBlazor.Core.Enums.OverlayPosition> position=null, System.Nullable<bool> rotationEnabled=null, System.Nullable<double> scale=null, dymaptic.GeoBlazor.Pro.Components.TrackViewModel? 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
dymaptic.GeoBlazor.Core.Options.GeoLocationOptions
An object used for setting optional position parameters.
default null
ArcGIS Maps SDK for JavaScript
goToLocationEnabled
System.Nullable<System.Boolean>
Indicates whether the widget will automatically navigate the view to the user’s position
when a geolocation result is found.
default true
ArcGIS Maps SDK for JavaScript
goToOverride
dymaptic.GeoBlazor.Core.Functions.GoToOverride
This function provides the ability to override either the MapView goTo() or SceneView goTo() methods.
ArcGIS Maps SDK for JavaScript
graphic
dymaptic.GeoBlazor.Core.Components.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-north-circle”
ArcGIS Maps SDK for JavaScript
label
System.String
The widget’s default label.
ArcGIS Maps SDK for JavaScript
mapView
dymaptic.GeoBlazor.Core.Components.Views.MapView
If the Widget is defined outside of the MapView, this link is required to connect them together.
position
System.Nullable<dymaptic.GeoBlazor.Core.Enums.OverlayPosition>
The position of the widget in relation to the map view.
rotationEnabled
System.Nullable<System.Boolean>
Indicates whether the widget will automatically rotate to the device heading based on
the Geolocation APIs GeolocationCoordinates.heading
property.
default true
ArcGIS Maps SDK for JavaScript
scale
System.Nullable<System.Double>
Indicates the scale to set on the view when navigating to the position of the geolocated
result, after a location is returned from the track event.
default null
ArcGIS Maps SDK for JavaScript
viewModel
TrackViewModel
The viewModel 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
TrackWidget.EventRateLimitInMilliseconds Property
Controls how often the events are fired.
public int EventRateLimitInMilliseconds { get; set; }
Property Value
TrackWidget.GeolocationOptions Property
An object used for setting optional position parameters.
default null
ArcGIS Maps SDK for JavaScript
public dymaptic.GeoBlazor.Core.Options.GeoLocationOptions? GeolocationOptions { get; set; }
Property Value
dymaptic.GeoBlazor.Core.Options.GeoLocationOptions
TrackWidget.GoToLocationEnabled Property
Indicates whether the widget will automatically navigate the view to the user’s position when a geolocation result is found. Set to false to disable this behavior, leaving full control to the developer.
Default Value:true
public System.Nullable<bool> GoToLocationEnabled { get; set; }
Property Value
System.Nullable<System.Boolean>
TrackWidget.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
dymaptic.GeoBlazor.Core.Functions.GoToOverride
TrackWidget.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
dymaptic.GeoBlazor.Core.Components.Graphic
TrackWidget.HasTrackErrorListener Property
Used in JavaScript layer to determine if the event listener is registered.
public bool HasTrackErrorListener { get; }
Property Value
TrackWidget.HasTrackListener Property
Used in JavaScript layer to determine if the event listener is registered.
public bool HasTrackListener { get; }
Property Value
TrackWidget.OnTrack Property
Event Listener for Track.
public Microsoft.AspNetCore.Components.EventCallback<dymaptic.GeoBlazor.Pro.Events.TrackEvent> OnTrack { get; set; }
Property Value
Microsoft.AspNetCore.Components.EventCallback<TrackEvent>
TrackWidget.OnTrackError Property
Event Listener for TrackError.
public Microsoft.AspNetCore.Components.EventCallback<dymaptic.GeoBlazor.Pro.Events.TrackErrorEvent> OnTrackError { get; set; }
Property Value
Microsoft.AspNetCore.Components.EventCallback<TrackErrorEvent>
TrackWidget.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>
TrackWidget.Scale Property
Indicates the scale to set on the view when navigating to the position of the geolocated result, after a location is returned from the track event.
By default, the view will navigate to a scale of 2500 for 3D and 4514 for 2D. To override the default in 2D, set the scale property and also set snapToZoom to false. For 2D views the value should be within the effectiveMinScale and effectiveMaxScale.
public System.Nullable<double> Scale { get; set; }
Property Value
System.Nullable<System.Double>
TrackWidget.Tracking Property
Indicates whether the widget is watching for new positions.
default false
ArcGIS Maps SDK for JavaScript
public System.Nullable<bool> Tracking { get; set; }
Property Value
System.Nullable<System.Boolean>
TrackWidget.Type Property
The type of widget
public override dymaptic.GeoBlazor.Core.Enums.WidgetType Type { get; }
Property Value
dymaptic.GeoBlazor.Core.Enums.WidgetType
TrackWidget.ViewModel Property
The viewModel for this widget.
ArcGIS Maps SDK for JavaScript
public dymaptic.GeoBlazor.Pro.Components.TrackViewModel? ViewModel { get; set; }
Property Value
Methods
TrackWidget.GetGeolocationOptions() Method
Asynchronously retrieve the current value of the GeolocationOptions property.
public System.Threading.Tasks.Task<dymaptic.GeoBlazor.Core.Options.GeoLocationOptions?> GetGeolocationOptions();
Returns
System.Threading.Tasks.Task<dymaptic.GeoBlazor.Core.Options.GeoLocationOptions>
TrackWidget.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>>
TrackWidget.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<dymaptic.GeoBlazor.Core.Components.Graphic>
TrackWidget.GetRotationEnabled() Method
Asynchronously retrieve the current value of the RotationEnabled property.
public System.Threading.Tasks.Task<System.Nullable<bool>> GetRotationEnabled();
Returns
System.Threading.Tasks.Task<System.Nullable<System.Boolean>>
TrackWidget.GetScale() Method
Asynchronously retrieve the current value of the Scale property.
public System.Threading.Tasks.Task<System.Nullable<double>> GetScale();
Returns
System.Threading.Tasks.Task<System.Nullable<System.Double>>
TrackWidget.GetTracking() Method
Asynchronously retrieve the current value of the Tracking property.
public System.Threading.Tasks.Task<System.Nullable<bool>> GetTracking();
Returns
System.Threading.Tasks.Task<System.Nullable<System.Boolean>>
TrackWidget.GetViewModel() Method
Asynchronously retrieve the current value of the ViewModel property.
public System.Threading.Tasks.Task<dymaptic.GeoBlazor.Pro.Components.TrackViewModel?> GetViewModel();
Returns
System.Threading.Tasks.Task<TrackViewModel>
TrackWidget.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
TrackWidget.OnJsTrack(IJSStreamReference) Method
JavaScript-Invokable Method for internal use only.
public System.Threading.Tasks.Task OnJsTrack(Microsoft.JSInterop.IJSStreamReference jsStreamRef);
Parameters
jsStreamRef
Microsoft.JSInterop.IJSStreamReference
Returns
TrackWidget.OnJsTrackError(IJSStreamReference) Method
JavaScript-Invokable Method for internal use only.
public System.Threading.Tasks.Task OnJsTrackError(Microsoft.JSInterop.IJSStreamReference jsStreamRef);
Parameters
jsStreamRef
Microsoft.JSInterop.IJSStreamReference
Returns
TrackWidget.SetGeolocationOptions(GeoLocationOptions) Method
Asynchronously set the value of the GeolocationOptions property after render.
public System.Threading.Tasks.Task SetGeolocationOptions(dymaptic.GeoBlazor.Core.Options.GeoLocationOptions? value);
Parameters
value
dymaptic.GeoBlazor.Core.Options.GeoLocationOptions
The value to set.
Returns
TrackWidget.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
TrackWidget.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
dymaptic.GeoBlazor.Core.Components.Graphic
The value to set.
Returns
TrackWidget.SetRotationEnabled(Nullable) Method
Asynchronously set the value of the RotationEnabled property after render.
public System.Threading.Tasks.Task SetRotationEnabled(System.Nullable<bool> value);
Parameters
value
System.Nullable<System.Boolean>
The value to set.
Returns
TrackWidget.SetScale(Nullable) Method
Asynchronously set the value of the Scale property after render.
public System.Threading.Tasks.Task SetScale(System.Nullable<double> value);
Parameters
value
System.Nullable<System.Double>
The value to set.
Returns
TrackWidget.SetViewModel(TrackViewModel) Method
Asynchronously set the value of the ViewModel property after render.
public System.Threading.Tasks.Task SetViewModel(dymaptic.GeoBlazor.Pro.Components.TrackViewModel? value);
Parameters
value
TrackViewModel
The value to set.
Returns
TrackWidget.Start() Method
When executed, the widget will start tracking the
user’s location.
ArcGIS Maps SDK for JavaScript
public System.Threading.Tasks.Task Start();
Returns
TrackWidget.Stop() Method
Stops tracking the user’s location when executed.
ArcGIS Maps SDK for JavaScript
public System.Threading.Tasks.Task Stop();
Returns
TrackWidget.ValidateRequiredGeneratedChildren() Method
Validates source-generated child components.
public override void ValidateRequiredGeneratedChildren();
Implements ValidateRequiredGeneratedChildren()