Geolocation 클래스

정의

디바이스의 현재 위치를 가져오는 방법을 제공합니다.

public ref class Geolocation abstract sealed
public static class Geolocation
type Geolocation = class
Public Class Geolocation
상속
Geolocation

속성

Default

이 API의 정적 사용에 대한 기본 구현을 제공합니다.

IsListeningForeground

앱이 포그라운드에 있는 동안 현재 위치 업데이트를 수신 대기하는지 나타냅니다.

메서드

GetLastKnownLocationAsync()

디바이스의 마지막으로 알려진 위치를 반환합니다.

GetLocationAsync()

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

GetLocationAsync(GeolocationRequest)

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

GetLocationAsync(GeolocationRequest, CancellationToken)

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

StartListeningForegroundAsync(GeolocationListeningRequest)

이벤트 또는 이벤트를 사용하여 LocationChanged 위치 업데이트를 수신 대기하기 ListeningFailed 시작합니다. 이벤트는 앱이 포그라운드에 있는 경우에만 전송할 수 있습니다. Permissions.LocationWhenInUse 사용자의 요청입니다.

StopListeningForeground()

앱이 포그라운드에 있을 때 위치 업데이트 수신 대기를 중지합니다. 수신하지 않을 때는 효과가 없으며 IsListeningForeground 현재 false입니다.

이벤트

ListeningFailed

위치 업데이트를 수신 대기하는 동안 오류가 발생할 때 발생합니다. 이벤트가 발생하면 추가 위치 업데이트를 수신 대기하는 작업이 중지되고 더 이상 LocationChanged 이벤트가 전송되지 않습니다.

LocationChanged

위치 업데이트를 수신 대기하는 동안 발생합니다.

적용 대상