Wikitude SDK API Reference

API Docs for: 9.10.0
Show:

Location Class

Extends ARchitectObject
Module: AR

Location is an abstract class which describes a general location of a POI in the augmented scene.

It should never be instantiated directly.

Item Index

Properties

Methods

destroy

()

Inherited from ARchitectObject

Destroys the object.

distanceTo

(
  • location
)
Number

Returns the shortest distance ("as the crow flies") to the Location passed as an argument, ignoring any altitude property.

Example:
var location1 = new AR.GeoLocation(47.77317, 13.069929);
var location2 = new AR.GeoLocation(47.77317, 13.069929, 320.);
var location3 = new AR.GeoLocation(47.77317, 14.069929, 640.);
var dist = location2.distanceTo(location1); //dist = 0.
dist = location2.distanceTo(location3); //dist = 74730.

Parameters:

  • location Location

    The Location the distance should be calculated for.

Returns:

Number:

The numeric distance in meters.

distanceToUser

() Number

Returns the shortest distance ("as the crow flies") to the current location of the user, ignoring any altitude property.

If the current position of the user cannot be determined, undefined will be returned.

Returns:

Number:

The numeric distance in meters.

Properties

destroyed

Boolean

Inherited from ARchitectObject

Indicates if the object has already been destroyed.