GeoPosition
ClassThe location of the device.
- Available on all platforms
Since Lens Scripting v228
Index
Properties
Methods
Extends
Properties
altitude
altitude:
number
Represents the position's elevation from sea level in meters. Value will be zero if not available.
Since
Lens Scripting Version 301
Default Value
0
heading
readonlyheading:number
Represents the direction towards which the device is facing. This value, specified in degrees, indicates how far off from heading true north the device is. 0 degrees represents true north, and the direction is determined clockwise. The recommended alternative to this field is to use onNorthAlignedOrientationUpdate which provides more accurate and frequent updates.
Spectacles Not supported, use onNorthAlignedOrientationUpdate instead
Since
Lens Scripting Version 228
horizontalAccuracy
horizontalAccuracy:
number
The accuracy of the latitude and longitude properties, expressed in meters.
Since
Lens Scripting Version 228
Default Value
0
isHeadingAvailable
readonlyisHeadingAvailable:boolean
Indicates whether the device is able to provide heading information.
Spectacles Not supported, use onNorthAlignedOrientationUpdate instead
Since
Lens Scripting Version 228
latitude
latitude:
number
The position's latitude in decimal degrees.
Since
Lens Scripting Version 228
Default Value
0
locationSource
locationSource:
string
Represents the location source of the provided location
| Value | Description |
|---|---|
| NOT_AVAILABLE | Unknown source. Non-wearables users will always receive this option |
| GNSS_RECEIVER | Uses built-in antenna to acquire a location. Not expected to work indoors or in challenging scenarios where reception is poor. |
| WIFI_POSITIONING_SYSTEM | Provides rough location in indoor and challenging scenarios. Useful for urban environments with no GPS reception. |
| FUSED_LOCATION | Provides a fused location between several location sources. Accuracy is dependent on the accuracy of the sources. Update frequency coincides with rendering rate. Ideal for navigation scenarios. Enable this source by selecting Navigation Location Accuracy. |
Since
Lens Scripting Version 301
longitude
longitude:
number
The position's longitude in decimal degrees.
Since
Lens Scripting Version 228
Default Value
0
timestamp
timestamp:
Date
Represents the date and time when the location coordinates were acquired.
Since
Lens Scripting Version 301
verticalAccuracy
verticalAccuracy:
number
The accuracy of the altitude property, expressed in meters.
Since
Lens Scripting Version 228
Default Value
0
Methods
create()
staticcreate():GeoPosition
Create a new GeoPosition.
Returns
GeoPosition
Since
Lens Scripting Version 228
getTypeName()
staticgetTypeName():TypeName<GeoPosition>
Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().
Returns
TypeName<GeoPosition>
Since
Lens Scripting Version 228
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object matches or derives from the passed in type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean