Skip to main content

GeoPosition

Class

The location of the device.

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

Since Lens Scripting v228

Index

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

readonly heading: 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

readonly isHeadingAvailable: 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

ValueDescription
NOT_AVAILABLEUnknown source. Non-wearables users will always receive this option
GNSS_RECEIVERUses built-in antenna to acquire a location. Not expected to work indoors or in challenging scenarios where reception is poor.
WIFI_POSITIONING_SYSTEMProvides rough location in indoor and challenging scenarios. Useful for urban environments with no GPS reception.
FUSED_LOCATIONProvides 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()

static create(): GeoPosition

Create a new GeoPosition.

Returns

GeoPosition

Since

Lens Scripting Version 228


getTypeName()

static getTypeName(): 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

ScriptObject.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

ScriptObject.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object matches or derives from the passed in type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

ScriptObject.isOfType


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

ParameterType
otherScriptObject

Returns

boolean

Inherited from

ScriptObject.isSame