Wikitude SDK API Reference

API Docs for: 8.2.0
Show:

ActionRange Class

Extends ActionArea
Module: AR

An ActionRange defines a circle around a certain Location. Events are fired as soon as the user enters or leaves this circle.

Example:
var location1 = new AR.GeoLocation(47.77317, 13.069929);
var actionRange = new AR.ActionRange(location1, 500);
var location2 = new AR.GeoLocation(48.77317, 13.069929);
var inArea1 = actionRange.isInArea(location1); //inArea1 = true
var inArea2 = actionRange.isInArea(location2); //inArea2 = false

On creation, setup parameters can be passed to customize the properties of the ImageDrawable.

var actionRange2 = new AR.ActionRange(location1, 500, {
    onEnter : function() {
        actionRange2.enabled = false; //an ActionArea which can only be entered once
    }
});

Constructor

ActionRange

(
  • location
  • radius
  • options
)

Parameters:

  • location Location

    a single Location defining the center point of the circle.

  • radius Number

    the radius of the ActionRange in meters.

  • options Object optional

    Setup-Parameters to customize additional object properties.

    Accepted options-properties are

Item Index

Methods

Events

Methods

destroy

()

Inherited from ARchitectObject

Destroys the object.

isInArea

(
  • geoLocation
)
Boolean

Inherited from ActionArea

checks if a certain location is within this ActionArea.

Parameters:

  • geoLocation GeoLocation

    the GeoLocation that should be checked.

Returns:

Boolean:

true if the geoLocation passed to the method is within the ActionArea, false if the geoLocation passed to the method is not in the ActionArea

Properties

destroyed

Boolean

Inherited from ARchitectObject

Indicates if the object has already been destroyed.

enabled

Boolean

Inherited from ActionArea

Flag to enable/disable the ActionArea. If the ActionArea is disabled, triggers on this ActionArea will never be fired. In case it is enabled, it can fire triggers.

location

Location

The Location object which defines the center of the ActionRange

radius

Number

The radius of the ActionRange, in SDUs.

Events

onEnter

Inherited from ActionArea

The trigger is executed when the user enters the ActionArea.

The trigger is null by default, and will thus result in no action executed when the trigger fires. A developer can add custom functionality by assigning a custom function to onEnter.

onExit

Inherited from ActionArea

The trigger is executed when the user leaves the ActionArea.

The trigger is null by default, and will thus result in no action executed when the trigger fires. A developer can add custom functionality by assigning a custom function to onExit.