HERE Android SDK Developer's Guide

OnGestureListener

The interface OnGestureListener is a member of com.here.android.mpa.mapping.MapGesture.

Interface Summary

public static abstract interface MapGesture.OnGestureListener

Event Listener interface for gesture events.

[For complete information, see the section Interface Details]

Nested Class Summary

Table 1. Nested Classes in OnGestureListener
Nested Classes

public static abstract class MapGesture.OnGestureListener.OnGestureListenerAdapter

Default implementation for the OnGestureListener interface.

Method Summary

Table 2. Methods in OnGestureListener
Methods

public abstract boolean onDoubleTapEvent (PointF p)

A callback indicating that a user has performed a double tap gesture on a map.

public abstract boolean onLongPressEvent (PointF p)

A callback indicating that a user has performed a long-press gesture on a map.

public abstract void onLongPressRelease ()

A callback indicating that a user has released a long-press gesture on a map.

public abstract boolean onMapObjectsSelected (java.util.List <ViewObject> objects)

A callback indicating that at least one ViewObject has been selected as a result of a user tapping on the map.

public abstract void onMultiFingerManipulationEnd ()

A callback indicating the user has removed all or all-except-one fingers from the screen.

public abstract void onMultiFingerManipulationStart ()

A callback indicating the user has put more than one finger onto the screen.

public abstract void onPanEnd ()

A callback indicating the user has lifted up their finger and stopped panning.

public abstract void onPanStart ()

A callback indicating the user has put one finger on the screen and moved their finger to trigger panning.

public abstract void onPinchLocked ()

A callback indicating that a user has pinched enough to be recognized as the two-finger zoom gesture.

public abstract boolean onPinchZoomEvent (float scaleFactor, PointF p)

A callback indicating that a user has performed a pinch-to-zoom gesture on a map.

public abstract boolean onRotateEvent (float rotateAngle)

A callback indicating that a user has performed a rotate gesture on a map.

public abstract void onRotateLocked ()

A callback indicating that a user has rotated enough to be recognized as the two-finger rotation gesture.

public abstract boolean onTapEvent (PointF p)

A callback indicating that a user has performed a single-tap gesture on a map.

public abstract boolean onTiltEvent (float angle)

A callback indicating that a user has performed a two-finger-tilt gesture on a map.

public abstract boolean onTwoFingerTapEvent (PointF p)

A callback indicating that a user has performed a two-finger tap gesture on a map.

Interface Details

Event Listener interface for gesture events. Please use MapGesture.OnGestureListener if all events are necessary and MapGesture.OnGestureListener.OnGestureListenerAdapter if some events are required. This interface can be added via MapGesture.addOnGestureListener(OnGestureListener) and removed via MapGesture.removeOnGestureListener(OnGestureListener). Please see MapGesture for a full set of configurable APIs.

Method Details

public abstract boolean onDoubleTapEvent (PointF p)

A callback indicating that a user has performed a double tap gesture on a map.

Parameters:

  • p

    A PointF representing the on-screen point of the double-tap gesture

Returns:

True if consumed (which prevents the default map zoom-in behavior), false otherwise

public abstract boolean onLongPressEvent (PointF p)

A callback indicating that a user has performed a long-press gesture on a map.

If a MapMarker with dragging enabled is located at the same location, returning true for this method will nullify that setting.

Parameters:

  • p

    A PointF representing the on-screen point where a user has long-pressed

Returns:

True if consumed (which prevents the default map move-to-here behavior), false otherwise

See also:

setDraggable(boolean)

public abstract void onLongPressRelease ()

A callback indicating that a user has released a long-press gesture on a map.

This callback may also occur when the user has panned around the map.

public abstract boolean onMapObjectsSelected (java.util.List <ViewObject> objects)

A callback indicating that at least one ViewObject has been selected as a result of a user tapping on the map.

If the user tapping on the map results in ViewObject selection (there are selectable objects located at the tap point), this callback will be made after onTapEvent(PointF), if and only if, false is returned for that callback.

Parameters:

  • objects

    A list of selected ViewObject objects

Returns:

true if consumed, false otherwise

See also:

getSelectedObjects(PointF)

public abstract void onMultiFingerManipulationEnd ()

A callback indicating the user has removed all or all-except-one fingers from the screen.

public abstract void onMultiFingerManipulationStart ()

A callback indicating the user has put more than one finger onto the screen. Pinch, Rotate or Tilt manipulation events may also be called back.

See also:

onTiltEvent(float)

onRotateEvent(float)

onPinchZoomEvent(float, PointF)

public abstract void onPanEnd ()

A callback indicating the user has lifted up their finger and stopped panning.

public abstract void onPanStart ()

A callback indicating the user has put one finger on the screen and moved their finger to trigger panning.

public abstract void onPinchLocked ()

A callback indicating that a user has pinched enough to be recognized as the two-finger zoom gesture. This callback will only occur if MapGesture is set to exclusive mode from setPinchEnabled(boolean).

See also:

setPinchEnabled(boolean)

public abstract boolean onPinchZoomEvent (float scaleFactor, PointF p)

A callback indicating that a user has performed a pinch-to-zoom gesture on a map.

Parameters:

  • scaleFactor

    A scale factor relative to the points of the two simultaneous touches at separate screen coordinates

  • p

    A PointF representing the on-screen point of the pinch gesture

Returns:

True if consumed (which prevents the default map zoom-in or zoom-out behavior), false otherwise

public abstract boolean onRotateEvent (float rotateAngle)

A callback indicating that a user has performed a rotate gesture on a map.

Parameters:

  • rotateAngle

    An angle, in degrees, of the user interaction gesture since its last change

Returns:

True if consumed (which prevents the default map rotate-to-here behavior), false otherwise

public abstract void onRotateLocked ()

A callback indicating that a user has rotated enough to be recognized as the two-finger rotation gesture. This callback will only occur if MapGesture is set to exclusive mode from setRotateEnabled(boolean)

See also:

setRotateEnabled(boolean)

public abstract boolean onTapEvent (PointF p)

A callback indicating that a user has performed a single-tap gesture on a map.

If true is returned from this callback, no onMapObjectsSelected(List) callback will be made to any gesture subscribers even if any objects are found at the screen point.

Parameters:

  • p

    A PointF representing the on-screen point of the single-tap gesture

Returns:

true if consumed (which prevents the default pan-to-here behavior), false otherwise.

See also:

getSelectedObjects(PointF)

public abstract boolean onTiltEvent (float angle)

A callback indicating that a user has performed a two-finger-tilt gesture on a map.

Parameters:

  • angle

    An angle, in degrees, to which the map tilt is to change.

Returns:

True if consumed (which prevents the default map tilt-to-here behavior), false otherwise

public abstract boolean onTwoFingerTapEvent (PointF p)

A callback indicating that a user has performed a two-finger tap gesture on a map.

Parameters:

  • p

    A PointF representing the on-screen point where the two-finger tap occurred

Returns:

True if consumed (which prevents the default map zoom-out behavior), false otherwise

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.