다음을 통해 공유


Geolocation.GetLocationAsync 메서드

정의

오버로드

GetLocationAsync()

디바이스의 현재 위치를 반환합니다.

GetLocationAsync(GeolocationRequest)

디바이스의 현재 위치를 반환합니다.

GetLocationAsync(GeolocationRequest, CancellationToken)

디바이스의 현재 위치를 반환합니다.

GetLocationAsync()

Source:
Geolocation.shared.cs
Source:
Geolocation.shared.cs

디바이스의 현재 위치를 반환합니다.

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)

반환

Location 현재 위치 정보를 포함하는 개체이거나 null 위치를 확인할 수 없는 경우 입니다.

설명

필요한 경우 런타임에 위치 권한이 요청됩니다. 앱 매니페스트에서 무언가를 선언해야 할 수도 있습니다.

적용 대상

GetLocationAsync(GeolocationRequest)

Source:
Geolocation.shared.cs
Source:
Geolocation.shared.cs

디바이스의 현재 위치를 반환합니다.

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)

매개 변수

request
GeolocationRequest

디바이스의 위치를 결정할 때 사용할 조건입니다.

반환

Location 현재 위치 정보를 포함하는 개체이거나 null 위치를 확인할 수 없는 경우 입니다.

설명

필요한 경우 런타임에 위치 권한이 요청됩니다. 앱 매니페스트에서 무언가를 선언해야 할 수도 있습니다.

적용 대상

GetLocationAsync(GeolocationRequest, CancellationToken)

Source:
Geolocation.shared.cs
Source:
Geolocation.shared.cs

디바이스의 현재 위치를 반환합니다.

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)

매개 변수

request
GeolocationRequest

디바이스의 위치를 결정할 때 사용할 조건입니다.

cancelToken
CancellationToken

작업을 취소하는 데 사용할 수 있는 토큰입니다.

반환

Location 현재 위치 정보를 포함하는 개체이거나 null 위치를 확인할 수 없는 경우 입니다.

설명

필요한 경우 런타임에 위치 권한이 요청됩니다. 앱 매니페스트에서 무언가를 선언해야 할 수도 있습니다.

적용 대상