Geolocation.GetLocationAsync Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
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
Commenti e suggerimenti
https://aka.ms/ContentUserFeedback.
Presto disponibile: Nel corso del 2024 verranno gradualmente disattivati i problemi di GitHub come meccanismo di feedback per il contenuto e ciò verrà sostituito con un nuovo sistema di feedback. Per altre informazioni, vedereInvia e visualizza il feedback per