Condividi tramite


Geolocation.GetLocationAsync Metodo

Definizione

Overload

GetLocationAsync()

Restituisce la posizione corrente del dispositivo.

GetLocationAsync(GeolocationRequest)

Restituisce la posizione corrente del dispositivo.

GetLocationAsync(GeolocationRequest, CancellationToken)

Restituisce la posizione corrente del dispositivo.

GetLocationAsync()

Origine:
Geolocation.shared.cs
Origine:
Geolocation.shared.cs

Restituisce la posizione corrente del dispositivo.

public:
 static System::Threading::Tasks::Task<Microsoft::Maui::Devices::Sensors::Location ^> ^ GetLocationAsync();
public static System.Threading.Tasks.Task<Microsoft.Maui.Devices.Sensors.Location?> GetLocationAsync ();
static member GetLocationAsync : unit -> System.Threading.Tasks.Task<Microsoft.Maui.Devices.Sensors.Location>
Public Shared Function GetLocationAsync () As Task(Of Location)

Restituisce

Oggetto Location contenente informazioni sulla posizione corrente o null se non è possibile determinare alcuna posizione.

Commenti

Se necessario, le autorizzazioni per la posizione verranno richieste in fase di esecuzione. Potrebbe essere comunque necessario dichiarare qualcosa nel manifesto dell'app.

Si applica a

GetLocationAsync(GeolocationRequest)

Origine:
Geolocation.shared.cs
Origine:
Geolocation.shared.cs

Restituisce la posizione corrente del dispositivo.

public:
 static System::Threading::Tasks::Task<Microsoft::Maui::Devices::Sensors::Location ^> ^ GetLocationAsync(Microsoft::Maui::Devices::Sensors::GeolocationRequest ^ request);
public static System.Threading.Tasks.Task<Microsoft.Maui.Devices.Sensors.Location?> GetLocationAsync (Microsoft.Maui.Devices.Sensors.GeolocationRequest request);
static member GetLocationAsync : Microsoft.Maui.Devices.Sensors.GeolocationRequest -> System.Threading.Tasks.Task<Microsoft.Maui.Devices.Sensors.Location>
Public Shared Function GetLocationAsync (request As GeolocationRequest) As Task(Of Location)

Parametri

request
GeolocationRequest

Criteri da usare per determinare la posizione del dispositivo.

Restituisce

Oggetto Location contenente informazioni sulla posizione corrente o null se non è possibile determinare alcuna posizione.

Commenti

Se necessario, le autorizzazioni per la posizione verranno richieste in fase di esecuzione. Potrebbe essere comunque necessario dichiarare qualcosa nel manifesto dell'app.

Si applica a

GetLocationAsync(GeolocationRequest, CancellationToken)

Origine:
Geolocation.shared.cs
Origine:
Geolocation.shared.cs

Restituisce la posizione corrente del dispositivo.

public:
 static System::Threading::Tasks::Task<Microsoft::Maui::Devices::Sensors::Location ^> ^ GetLocationAsync(Microsoft::Maui::Devices::Sensors::GeolocationRequest ^ request, System::Threading::CancellationToken cancelToken);
public static System.Threading.Tasks.Task<Microsoft.Maui.Devices.Sensors.Location?> GetLocationAsync (Microsoft.Maui.Devices.Sensors.GeolocationRequest request, System.Threading.CancellationToken cancelToken);
static member GetLocationAsync : Microsoft.Maui.Devices.Sensors.GeolocationRequest * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Maui.Devices.Sensors.Location>
Public Shared Function GetLocationAsync (request As GeolocationRequest, cancelToken As CancellationToken) As Task(Of Location)

Parametri

request
GeolocationRequest

Criteri da usare per determinare la posizione del dispositivo.

cancelToken
CancellationToken

Token che può essere usato per annullare l'operazione.

Restituisce

Oggetto Location contenente informazioni sulla posizione corrente o null se non è possibile determinare alcuna posizione.

Commenti

Se necessario, le autorizzazioni per la posizione verranno richieste in fase di esecuzione. Potrebbe essere comunque necessario dichiarare qualcosa nel manifesto dell'app.

Si applica a