GeoBlazor Pro
dymaptic.GeoBlazor.Pro
dymaptic.GeoBlazor.Pro.Components
TrackViewModel Class
<a target=”_blank” href=”https://docs.geoblazor.com/pages/classes/dymaptic.GeoBlazor.Pro.Components.TrackViewModel.html”>GeoBlazor Docs</a> Provides the logic for the <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-track/”>Track</a> component and <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html”>Track</a> widget, which animates the <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html”>View</a> to the user’s location when clicked and tracks it as the location is updated. <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html”>ArcGIS Maps SDK for JavaScript</a>
public class TrackViewModel : dymaptic.GeoBlazor.Core.Components.MapComponent, dymaptic.GeoBlazor.Core.Interfaces.IGeolocationPositioning, dymaptic.GeoBlazor.Core.Interfaces.IMapComponent, dymaptic.GeoBlazor.Core.Interfaces.IGoTo
Inheritance System.Object 🡒 Microsoft.AspNetCore.Components.ComponentBase 🡒 dymaptic.GeoBlazor.Core.Components.MapComponent 🡒 TrackViewModel
Implements dymaptic.GeoBlazor.Core.Interfaces.IGeolocationPositioning, dymaptic.GeoBlazor.Core.Interfaces.IMapComponent, dymaptic.GeoBlazor.Core.Interfaces.IGoTo
Constructors
TrackViewModel() Constructor
Parameterless constructor for use as a Razor Component.
public TrackViewModel();
TrackViewModel(Error, GeolocationOptions, Nullable<bool>, GoToOverride, Graphic, Func<Task>, Nullable<double>) Constructor
Constructor for use in C# code. Use named parameters (e.g., item1: value1, item2: value2) to set properties in any order.
public TrackViewModel(dymaptic.GeoBlazor.Core.Model.Error? error=null, dymaptic.GeoBlazor.Core.Components.GeolocationOptions? geolocationOptions=null, System.Nullable<bool> goToLocationEnabled=null, dymaptic.GeoBlazor.Core.Functions.GoToOverride? goToOverride=null, dymaptic.GeoBlazor.Core.Components.Graphic? graphic=null, System.Func<System.Threading.Tasks.Task>? positionFilterFunction=null, System.Nullable<double> scale=null);
Parameters
error
dymaptic.GeoBlazor.Core.Model.Error
Error that caused the last <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#event:track-error”>track-error</a> event to fire. default null <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#error”>ArcGIS Maps SDK for JavaScript</a>
geolocationOptions
dymaptic.GeoBlazor.Core.Components.GeolocationOptions
An object used for setting optional position parameters. default null <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#geolocationOptions”>ArcGIS Maps SDK for JavaScript</a>
goToLocationEnabled
System.Nullable<System.Boolean>
Indicates whether to navigate the view to the position and scale of the geolocated result. default true <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#goToLocationEnabled”>ArcGIS Maps SDK for JavaScript</a>
goToOverride
dymaptic.GeoBlazor.Core.Functions.GoToOverride
This function provides the ability to override either the <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo”>MapView goTo()</a> or <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo”>SceneView goTo()</a> methods. <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GoTo.html#goToOverride”>ArcGIS Maps SDK for JavaScript</a>
graphic
dymaptic.GeoBlazor.Core.Components.Graphic
The graphic used to show the user’s location on the map. <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#graphic”>ArcGIS Maps SDK for JavaScript</a>
positionFilterFunction
System.Func<System.Threading.Tasks.Task>
A function that is used as an expression to evaluate geolocation points, and returns a boolean value. default null <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#positionFilterFunction”>ArcGIS Maps SDK for JavaScript</a>
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 <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#event-track”>track</a> event. default null <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#scale”>ArcGIS Maps SDK for JavaScript</a>
Properties
TrackViewModel.Error Property
<a target=”_blank” href=”https://docs.geoblazor.com/pages/classes/dymaptic.GeoBlazor.Pro.Components.TrackViewModel.html#trackviewmodelerror-property”>GeoBlazor Docs</a> Error that caused the last <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#event:track-error”>track-error</a> event to fire. default null <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#error”>ArcGIS Maps SDK for JavaScript</a>
public dymaptic.GeoBlazor.Core.Model.Error? Error { get; set; }
Property Value
dymaptic.GeoBlazor.Core.Model.Error
TrackViewModel.GeolocationOptions Property
<a target=”_blank” href=”https://docs.geoblazor.com/pages/classes/dymaptic.GeoBlazor.Pro.Components.TrackViewModel.html#trackviewmodelgeolocationoptions-property”>GeoBlazor Docs</a> An object used for setting optional position parameters. default null <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#geolocationOptions”>ArcGIS Maps SDK for JavaScript</a>
public dymaptic.GeoBlazor.Core.Components.GeolocationOptions? GeolocationOptions { get; set; }
Implements GeolocationOptions
Property Value
dymaptic.GeoBlazor.Core.Components.GeolocationOptions
TrackViewModel.GoToLocationEnabled Property
<a target=”_blank” href=”https://docs.geoblazor.com/pages/classes/dymaptic.GeoBlazor.Pro.Components.TrackViewModel.html#trackviewmodelgotolocationenabled-property”>GeoBlazor Docs</a> Indicates whether to navigate the view to the position and scale of the geolocated result. default true <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#goToLocationEnabled”>ArcGIS Maps SDK for JavaScript</a>
public System.Nullable<bool> GoToLocationEnabled { get; set; }
Implements GoToLocationEnabled
Property Value
System.Nullable<System.Boolean>
TrackViewModel.GoToOverride Property
This function provides the ability to override either the <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo”>MapView goTo()</a> or <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo”>SceneView goTo()</a> methods. <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GoTo.html#goToOverride”>ArcGIS Maps SDK for JavaScript</a>
public dymaptic.GeoBlazor.Core.Functions.GoToOverride? GoToOverride { get; set; }
Implements GoToOverride
Property Value
dymaptic.GeoBlazor.Core.Functions.GoToOverride
TrackViewModel.Graphic Property
<a target=”_blank” href=”https://docs.geoblazor.com/pages/classes/dymaptic.GeoBlazor.Pro.Components.TrackViewModel.html#trackviewmodelgraphic-property”>GeoBlazor Docs</a> The graphic used to show the user’s location on the map. <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#graphic”>ArcGIS Maps SDK for JavaScript</a>
public dymaptic.GeoBlazor.Core.Components.Graphic? Graphic { get; set; }
Implements Graphic
Property Value
dymaptic.GeoBlazor.Core.Components.Graphic
TrackViewModel.HasGoToOverride Property
A convenience property that signifies whether a custom GoToOverride function was registered.
public bool HasGoToOverride { get; }
Implements HasGoToOverride
Property Value
TrackViewModel.HasTrackErrorListener Property
Used in JavaScript layer to determine if the event listener is registered.
public bool HasTrackErrorListener { get; }
Property Value
TrackViewModel.HasTrackListener Property
Used in JavaScript layer to determine if the event listener is registered.
public bool HasTrackListener { get; }
Property Value
TrackViewModel.OnTrack Property
<a target=”_blank” href=”https://docs.geoblazor.com/pages/classes/dymaptic.GeoBlazor.Pro.Components.TrackViewModel.html#trackviewmodelontrack-property”>GeoBlazor Docs</a> Fires after the <a href=”#start”>start()</a> method is called and a position is found.
public Microsoft.AspNetCore.Components.EventCallback<dymaptic.GeoBlazor.Pro.Events.TrackViewModelTrackEvent> OnTrack { get; set; }
Property Value
Microsoft.AspNetCore.Components.EventCallback<TrackViewModelTrackEvent>
TrackViewModel.OnTrackError Property
<a target=”_blank” href=”https://docs.geoblazor.com/pages/classes/dymaptic.GeoBlazor.Pro.Components.TrackViewModel.html#trackviewmodelontrackerror-property”>GeoBlazor Docs</a> Fires after the <a href=”#start”>start()</a> method is called and an error is returned.
public Microsoft.AspNetCore.Components.EventCallback<dymaptic.GeoBlazor.Pro.Events.TrackViewModelTrackErrorEvent> OnTrackError { get; set; }
Property Value
Microsoft.AspNetCore.Components.EventCallback<TrackViewModelTrackErrorEvent>
TrackViewModel.PositionFilterFunction Property
<a target=”_blank” href=”https://docs.geoblazor.com/pages/classes/dymaptic.GeoBlazor.Pro.Components.TrackViewModel.html#trackviewmodelpositionfilterfunction-property”>GeoBlazor Docs</a> A function that is used as an expression to evaluate geolocation points, and returns a boolean value. default null <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#positionFilterFunction”>ArcGIS Maps SDK for JavaScript</a>
public System.Func<System.Threading.Tasks.Task>? PositionFilterFunction { get; set; }
Property Value
System.Func<System.Threading.Tasks.Task>
TrackViewModel.Scale Property
<a target=”_blank” href=”https://docs.geoblazor.com/pages/classes/dymaptic.GeoBlazor.Pro.Components.TrackViewModel.html#trackviewmodelscale-property”>GeoBlazor Docs</a> Indicates the scale to set on the view when navigating to the position of the geolocated result, after a location is returned from the <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#event-track”>track</a> event. default null <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#scale”>ArcGIS Maps SDK for JavaScript</a>
public System.Nullable<double> Scale { get; set; }
Implements Scale
Property Value
System.Nullable<System.Double>
TrackViewModel.State Property
<a target=”_blank” href=”https://docs.geoblazor.com/pages/classes/dymaptic.GeoBlazor.Pro.Components.TrackViewModel.html#trackviewmodelstate-property”>GeoBlazor Docs</a> The current state of the widget. default “disabled” <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#state”>ArcGIS Maps SDK for JavaScript</a>
public System.Nullable<dymaptic.GeoBlazor.Pro.Enums.TrackViewModelState> State { get; }
Property Value
System.Nullable<TrackViewModelState>
TrackViewModel.Tracking Property
<a target=”_blank” href=”https://docs.geoblazor.com/pages/classes/dymaptic.GeoBlazor.Pro.Components.TrackViewModel.html#trackviewmodeltracking-property”>GeoBlazor Docs</a> Indicates whether new positions are being watched. default false <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#tracking”>ArcGIS Maps SDK for JavaScript</a>
public System.Nullable<bool> Tracking { get; }
Property Value
System.Nullable<System.Boolean>
Methods
TrackViewModel.GetError() Method
Asynchronously retrieve the current value of the Error property.
public System.Threading.Tasks.Task<dymaptic.GeoBlazor.Core.Model.Error?> GetError();
Returns
System.Threading.Tasks.Task<dymaptic.GeoBlazor.Core.Model.Error>
TrackViewModel.GetGeolocationOptions() Method
Asynchronously retrieve the current value of the GeolocationOptions property.
public System.Threading.Tasks.Task<dymaptic.GeoBlazor.Core.Components.GeolocationOptions?> GetGeolocationOptions();
Implements GetGeolocationOptions()
Returns
System.Threading.Tasks.Task<dymaptic.GeoBlazor.Core.Components.GeolocationOptions>
TrackViewModel.GetGoToLocationEnabled() Method
Asynchronously retrieve the current value of the GoToLocationEnabled property.
public System.Threading.Tasks.Task<System.Nullable<bool>> GetGoToLocationEnabled();
Implements GetGoToLocationEnabled()
Returns
System.Threading.Tasks.Task<System.Nullable<System.Boolean>>
TrackViewModel.GetGraphic() Method
Asynchronously retrieve the current value of the Graphic property.
public System.Threading.Tasks.Task<dymaptic.GeoBlazor.Core.Components.Graphic?> GetGraphic();
Implements GetGraphic()
Returns
System.Threading.Tasks.Task<dymaptic.GeoBlazor.Core.Components.Graphic>
TrackViewModel.GetPositionFilterFunction() Method
Asynchronously retrieve the current value of the PositionFilterFunction property.
public System.Threading.Tasks.Task<System.Func<System.Threading.Tasks.Task>?> GetPositionFilterFunction();
Returns
System.Threading.Tasks.Task<System.Func<System.Threading.Tasks.Task>>
TrackViewModel.GetScale() Method
Asynchronously retrieve the current value of the Scale property.
public System.Threading.Tasks.Task<System.Nullable<double>> GetScale();
Implements GetScale()
Returns
System.Threading.Tasks.Task<System.Nullable<System.Double>>
TrackViewModel.GetState() Method
Asynchronously retrieve the current value of the State property.
public System.Threading.Tasks.Task<System.Nullable<dymaptic.GeoBlazor.Pro.Enums.TrackViewModelState>> GetState();
Returns
System.Threading.Tasks.Task<System.Nullable<TrackViewModelState>>
TrackViewModel.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>>
TrackViewModel.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
TrackViewModel.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
TrackViewModel.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
TrackViewModel.SetError(Error) Method
Asynchronously set the value of the Error property after render.
public System.Threading.Tasks.Task SetError(dymaptic.GeoBlazor.Core.Model.Error? value);
Parameters
value
dymaptic.GeoBlazor.Core.Model.Error
The value to set.
Returns
TrackViewModel.SetGeolocationOptions(GeolocationOptions) Method
Asynchronously set the value of the GeolocationOptions property after render.
public System.Threading.Tasks.Task SetGeolocationOptions(dymaptic.GeoBlazor.Core.Components.GeolocationOptions? value);
Parameters
value
dymaptic.GeoBlazor.Core.Components.GeolocationOptions
The value to set.
Implements SetGeolocationOptions(GeolocationOptions)
Returns
TrackViewModel.SetGoToLocationEnabled(Nullable<bool>) 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.
Implements SetGoToLocationEnabled(Nullable<bool>)
Returns
TrackViewModel.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.
Implements SetGraphic(Graphic)
Returns
TrackViewModel.SetPositionFilterFunction(Func<Task>) Method
Asynchronously set the value of the PositionFilterFunction property after render.
public System.Threading.Tasks.Task SetPositionFilterFunction(System.Func<System.Threading.Tasks.Task>? value);
Parameters
value
System.Func<System.Threading.Tasks.Task>
The value to set.
Returns
TrackViewModel.SetScale(Nullable<double>) 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.
Implements SetScale(Nullable<double>)
Returns
TrackViewModel.Start() Method
<a target=”_blank” href=”https://docs.geoblazor.com/pages/classes/dymaptic.GeoBlazor.Pro.Components.TrackViewModel.html#trackviewmodelstart-method”>GeoBlazor Docs</a> When executed, <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#tracking”>tracking</a> starts at the user’s location. <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#start”>ArcGIS Maps SDK for JavaScript</a>
public System.Threading.Tasks.Task Start();
Returns
TrackViewModel.Stop() Method
<a target=”_blank” href=”https://docs.geoblazor.com/pages/classes/dymaptic.GeoBlazor.Pro.Components.TrackViewModel.html#trackviewmodelstop-method”>GeoBlazor Docs</a> Stops tracking the user’s location when executed. <a target=”_blank” href=”https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#stop”>ArcGIS Maps SDK for JavaScript</a>
public System.Threading.Tasks.Task Stop();
Returns
TrackViewModel.ValidateRequiredGeneratedChildren() Method
Validates source-generated child components.
public override void ValidateRequiredGeneratedChildren();
Implements ValidateRequiredGeneratedChildren()