GeoBlazor Pro
layout: pro title: TrackWidget parent: Pro Classes grand_parent: 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. The view rotates based on device heading.
ArcGIS Maps SDK for JavaScript
public class TrackWidget : dymaptic.GeoBlazor.Pro.Components.Widgets.ProWidget
Inheritance System.Object 🡒 Microsoft.AspNetCore.Components.ComponentBase 🡒 dymaptic.GeoBlazor.Core.Components.MapComponent 🡒 dymaptic.GeoBlazor.Core.Components.Widgets.Widget 🡒 ProWidget 🡒 TrackWidget
Properties
TrackWidget.EventRateLimitInMilliseconds Property
Controls how often the events are fired.
public System.Nullable<int> EventRateLimitInMilliseconds { get; set; }
Property Value
TrackWidget.GeoLocationOptions Property
An object used for setting optional position parameters. Refer to the Geolocation API Specification for details on using these parameters.
public dymaptic.GeoBlazor.Pro.Components.Widgets.GeoLocationOptions? GeoLocationOptions { get; set; }
Property Value
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.Graphic Property
The graphic used to show the user’s location on the map. Overriding this will disable the default graphic’s heading indicator.
public dymaptic.GeoBlazor.Core.Components.Layers.Graphic? Graphic { get; set; }
Property Value
dymaptic.GeoBlazor.Core.Components.Layers.Graphic
TrackWidget.Label Property
The widget’s default label.
public string? Label { get; set; }
Property Value
TrackWidget.OnTrack Property
Event fired when a result is returned from the track widget.
public Microsoft.AspNetCore.Components.EventCallback<dymaptic.GeoBlazor.Pro.Components.Widgets.TrackEvent> OnTrack { get; set; }
Property Value
Microsoft.AspNetCore.Components.EventCallback<TrackEvent>
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>
Methods
TrackWidget.IsTracking() Method
Indicates whether the widget is watching for new positions.
public System.Threading.Tasks.Task<System.Nullable<bool>> IsTracking();
Returns
System.Threading.Tasks.Task<System.Nullable<System.Boolean>>
TrackWidget.OnJsTrack(TrackEvent) Method
Internal JavaScript-called method, do not call directly.
public System.Threading.Tasks.Task OnJsTrack(dymaptic.GeoBlazor.Pro.Components.Widgets.TrackEvent trackEvent);
Parameters
trackEvent
TrackEvent
Returns
TrackWidget.Start() Method
When executed, the widget will start tracking the user’s location. Only start the widget on a user gesture such as a click event.
public System.Threading.Tasks.Task Start();
Returns
TrackWidget.Stop() Method
Stops tracking the user’s location when executed.
public System.Threading.Tasks.Task Stop();