Skip to main content
←API Reference ←com.nianticspatial.nsdk.vps2 ←Vps2Session

getDeviceGeolocation


Declaration​

fun getDeviceGeolocation(headingMode: HeadingMode = HeadingMode.CAMERA_DIRECTION): Vps2GeolocationData?

Summary​

Get the geolocation of the device's last known camera pose.


Equivalent to passing the last camera pose to getGeolocation, with the heading derived
according to headingMode.

Returns​

Vps2GeolocationData if available, null otherwise.

Throws​

  • NsdkInvalidOperationStatusException — if the current localization tracking state is Vps2TrackingState.UNAVAILABLE.

Parameters​

NameTypeSummary
headingModeHeadingMode
Controls how the heading is derived. Use [HeadingMode.CAMERA_DIRECTION] when the device is upright, or [HeadingMode.DEVICE_TOP] when flat or for a compass-style heading.