지리적 위치 API
지리적 위치 개체
Geolocation 개체를 사용하면 사용자가 웹 응용 프로그램에 위치를 제공할 수 있습니다. 개인 정보 보호를 위해 사용자는 위치 정보를 보고할 수 있는 권한을 요청받습니다.
참고: 이 기능은 보안 컨텍스트(HTTPS)에서만 사용할 수 있습니다.
참고: 지리적 위치는 iPhone과 같이 GPS가 있는 기기에서 가장 정확합니다.
Geolocation API는 navigator.geolocation 객체를 통해 게시됩니다.
지리적 위치 개체 속성
Property | Description |
---|---|
coordinates | Returns the position and altitude of the device on Earth |
position | Returns the position of the concerned device at a given time |
positionError | Returns the reason of an error occurring when using the geolocating device |
positionOptions | Describes an object containing option properties to pass as a parameter of Geolocation.getCurrentPosition() and Geolocation.watchPosition() |
지리적 위치 개체 메서드
Method | Description |
---|---|
clearWatch() | Unregister location/error monitoring handlers previously installed using Geolocation.watchPosition() |
getCurrentPosition() | Returns the current position of the device |
watchPosition() | Returns a watch ID value that then can be used to unregister the handler by passing it to the Geolocation.clearWatch() method |