Class: TapRecognizer

TapRecognizer(target, callback)

A concrete gesture recognizer subclass that looks for single or multiple taps.

Constructor

new TapRecognizer(target, callback)

Constructs a tap gesture recognizer.
Parameters:
Name Type Description
target EventTarget The document element this gesture recognizer observes for mouse and touch events.
callback function An optional function to call when this gesture is recognized. If non-null, the function is called when this gesture is recognized, and is passed a single argument: this gesture recognizer, e.g., gestureCallback(recognizer).
Source:
Throws:
If the specified target is null or undefined.
Type
ArgumentError

Extends

Members

clientX :Number

Indicates the X coordinate of this gesture.
Type:
  • Number
Overrides:
Source:

clientY :Number

Returns the Y coordinate of this gesture.
Type:
  • Number
Overrides:
Source:

enabled :Boolean

Indicates whether or not this gesture recognizer is enabled. When false, this gesture recognizer will ignore any events dispatched by its target.
Type:
  • Boolean
Inherited From:
Default Value:
  • true
Source:

(readonly) gestureCallbacks :Array.<function()>

The list of functions to call when this gesture is recognized. The functions have a single argument: this gesture recognizer, e.g., gestureCallback(recognizer). Applications may add functions to this array or remove them.
Type:
  • Array.<function()>
Inherited From:
Source:

(readonly) mouseButtonMask :Number

Indicates the currently pressed mouse buttons as a bitmask. A value of 0 indicates that no buttons are pressed. A nonzero value indicates that one or more buttons are pressed as follows: bit 1 indicates the primary button, bit 2 indicates the the auxiliary button, bit 3 indicates the secondary button.
Type:
  • Number
Inherited From:
Source:

numberOfTaps :Number

Type:
  • Number
Source:

numberOfTouches :Number

Type:
  • Number
Source:

state :String

Indicates this gesture's current state. Possible values are WorldWind.POSSIBLE, WorldWind.FAILED, WorldWind.RECOGNIZED, WorldWind.BEGAN, WorldWind.CHANGED, WorldWind.CANCELLED and WorldWind.ENDED.
Type:
  • String
Overrides:
Default Value:
  • WorldWind.POSSIBLE
Source:

(readonly) target :EventTarget

Indicates the document element this gesture recognizer observes for UI events.
Type:
  • EventTarget
Inherited From:
Source:

(readonly) touchCount :Number

Indicates the number of active touches.
Type:
  • Number
Inherited From:
Source:

translationX :Number

Indicates this gesture's translation along the X axis since the gesture started.
Type:
  • Number
Inherited From:
Source:

translationY :Number

Indicates this gesture's translation along the Y axis since the gesture started.
Type:
  • Number
Inherited From:
Source:

Methods

addListener(listener)

Registers a gesture state listener on this GestureRecognizer. Registering state listeners using this function enables applications to receive notifications of gesture recognition. Listeners must implement a gestureStateChanged method to receive notifications. The gestureStateChanged method will receive one parameter containing a reference to the recognizer that changed state.
Parameters:
Name Type Description
listener The function to call when the event occurs.
Inherited From:
Source:
Throws:
If any argument is null or undefined.
Type
ArgumentError

canRecognizeSimultaneouslyWith(recognizer) → {Boolean}

Parameters:
Name Type Description
recognizer
Inherited From:
Source:
Returns:
Type
Boolean

(protected) mouseDown(event)

Parameters:
Name Type Description
event
Overrides:
Source:

(protected) mouseMove(event)

Parameters:
Name Type Description
event
Inherited From:
Source:

(protected) mouseUp(event)

Parameters:
Name Type Description
event
Inherited From:
Source:

(protected) prepareToRecognize()

Inherited From:
Source:

recognizeSimultaneouslyWith(recognizer)

Parameters:
Name Type Description
recognizer
Inherited From:
Source:

removeListener(listener)

Removes a gesture state listener from this GestureRecognizer. The listener must be the same object passed to addListener. Calling removeListener with arguments that do not identify a currently registered listener has no effect.
Parameters:
Name Type Description
listener The listener to remove. Must be the same object passed to addListener.
Inherited From:
Source:
Throws:
If any argument is null or undefined.
Type
ArgumentError

requiredToFailByRecognizer(recognizer) → {Boolean}

Parameters:
Name Type Description
recognizer
Inherited From:
Source:
Returns:
Type
Boolean

requireRecognizerToFail(recognizer)

Parameters:
Name Type Description
recognizer
Inherited From:
Source:

requiresRecognizerToFail(recognizer) → {Boolean}

Parameters:
Name Type Description
recognizer
Inherited From:
Source:
Returns:
Type
Boolean

(protected) reset()

Overrides:
Source:

touch(index) → {Touch}

Parameters:
Name Type Description
index
Inherited From:
Source:
Throws:
If the index is out of range.
Type
ArgumentError
Returns:
Type
Touch

(protected) touchCancel(touch)

Parameters:
Name Type Description
touch
Overrides:
Source:

(protected) touchEnd(touch)

Parameters:
Name Type Description
touch
Overrides:
Source:

(protected) touchMove(touch)

Parameters:
Name Type Description
touch
Overrides:
Source:

(protected) touchStart(touch)

Parameters:
Name Type Description
touch
Overrides:
Source: