ActionRange Class
An ActionRange defines a circle around a certain Location.
Events are fired as soon as the user enters or leaves this
circle.
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
Item Index
Methods
destroy
()
Destroys the object.
isInArea
-
geoLocation
checks if a certain location is within this ActionArea.
Parameters:
-
geoLocation
GeoLocationthe GeoLocation that should be checked.
Returns:
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
enabled
Boolean
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.
Events
onEnter
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
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.