dymaptic.GeoBlazor.Core
dymaptic.GeoBlazor.Core.Components
LocateViewModel Class
Provides the logic for the Locate component and Locate widget, which
animates the View
to the user’s current location.
ArcGIS Maps SDK for JavaScript
public class LocateViewModel : 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 🡒 MapComponent 🡒 LocateViewModel
Implements IGeolocationPositioning, IMapComponent, IGoTo
Constructors
LocateViewModel() Constructor
Parameterless constructor for use as a Razor Component.
public LocateViewModel();
LocateViewModel(Error, GeolocationOptions, Nullable, GoToOverride, Graphic, Nullable, 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 LocateViewModel(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.Nullable<bool> popupEnabled=null, System.Nullable<double> scale=null, string? stringError=null);
Parameters
error
Error
Error that caused the last locate-error event to fire.
default null
ArcGIS Maps SDK for JavaScript
geolocationOptions
GeolocationOptions
An object used for setting optional position parameters.
default null
ArcGIS Maps SDK for JavaScript
goToLocationEnabled
System.Nullable<System.Boolean>
Indicates whether to 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
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
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
stringError
System.String
Error that caused the last locate-error event to fire.
default null
ArcGIS Maps SDK for JavaScript
Properties
LocateViewModel.Error Property
Error that caused the last locate-error event to fire.
default null
ArcGIS Maps SDK for JavaScript
public dymaptic.GeoBlazor.Core.Model.Error? Error { get; set; }
Property Value
LocateViewModel.GeolocationOptions Property
An object used for setting optional position parameters.
default null
ArcGIS Maps SDK for JavaScript
public dymaptic.GeoBlazor.Core.Components.GeolocationOptions? GeolocationOptions { get; set; }
Implements GeolocationOptions
Property Value
LocateViewModel.GoToLocationEnabled Property
Indicates whether to 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; }
Implements GoToLocationEnabled
Property Value
System.Nullable<System.Boolean>
LocateViewModel.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)
LocateViewModel.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; }
Implements Graphic
Property Value
LocateViewModel.HasGoToOverride Property
A convenience property that signifies whether a custom GoToOverride function was registered.
public bool HasGoToOverride { get; }
Implements HasGoToOverride
Property Value
LocateViewModel.HasLocateErrorListener Property
Used in JavaScript layer to determine if the event listener is registered.
public bool HasLocateErrorListener { get; }
Property Value
LocateViewModel.HasLocateListener Property
Used in JavaScript layer to determine if the event listener is registered.
public bool HasLocateListener { get; }
Property Value
LocateViewModel.OnLocate Property
Fires after the locate() method is called and succeeds.
public Microsoft.AspNetCore.Components.EventCallback<dymaptic.GeoBlazor.Core.Events.LocateViewModelLocateEvent> OnLocate { get; set; }
Property Value
Microsoft.AspNetCore.Components.EventCallback<LocateViewModelLocateEvent>
LocateViewModel.OnLocateError Property
Fires after the locate() method is called and fails.
public Microsoft.AspNetCore.Components.EventCallback<dymaptic.GeoBlazor.Core.Events.LocateViewModelLocateErrorEvent> OnLocateError { get; set; }
Property Value
Microsoft.AspNetCore.Components.EventCallback<LocateViewModelLocateErrorEvent>
LocateViewModel.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>
LocateViewModel.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.
default null
ArcGIS Maps SDK for JavaScript
public System.Nullable<double> Scale { get; set; }
Implements Scale
Property Value
System.Nullable<System.Double>
LocateViewModel.State Property
The current state of the widget.
default “disabled”
ArcGIS Maps SDK for JavaScript
public System.Nullable<dymaptic.GeoBlazor.Core.Enums.LocateViewModelState> State { get; set; }
Property Value
System.Nullable<LocateViewModelState>
LocateViewModel.StringError Property
Error that caused the last locate-error event to fire.
default null
ArcGIS Maps SDK for JavaScript
public string? StringError { get; set; }
Property Value
Methods
LocateViewModel.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
LocateViewModel.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<Error>
LocateViewModel.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<GeolocationOptions>
LocateViewModel.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>>
LocateViewModel.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<Graphic>
LocateViewModel.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>>
LocateViewModel.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>>
LocateViewModel.GetState() Method
Asynchronously retrieve the current value of the State property.
public System.Threading.Tasks.Task<System.Nullable<dymaptic.GeoBlazor.Core.Enums.LocateViewModelState>> GetState();
Returns
System.Threading.Tasks.Task<System.Nullable<LocateViewModelState>>
LocateViewModel.GetStringError() Method
Asynchronously retrieve the current value of the StringError property.
public System.Threading.Tasks.Task<string?> GetStringError();
Returns
System.Threading.Tasks.Task<System.String>
LocateViewModel.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>
LocateViewModel.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
LocateViewModel.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
LocateViewModel.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
LocateViewModel.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
Error
The value to set.
Returns
LocateViewModel.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
GeolocationOptions
The value to set.
Implements SetGeolocationOptions(GeolocationOptions)
Returns
LocateViewModel.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.
Implements SetGoToLocationEnabled(Nullable<bool>)
Returns
LocateViewModel.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.
Implements SetGraphic(Graphic)
Returns
LocateViewModel.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
LocateViewModel.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.
Implements SetScale(Nullable<double>)
Returns
LocateViewModel.SetStringError(string) Method
Asynchronously set the value of the StringError property after render.
public System.Threading.Tasks.Task SetStringError(string? value);
Parameters
value
System.String
The value to set.
Returns
LocateViewModel.ValidateRequiredGeneratedChildren() Method
Validates source-generated child components.
public override void ValidateRequiredGeneratedChildren();
Implements ValidateRequiredGeneratedChildren()