Search code examples
here-apiheremaps

Swap Gestures in HERE sdk


I'm trying to remove the default pan behaviour, which is easily done with:

mapView.getGestures().disableDefaultAction(GestureType.PAN);

and use the TWO_FINGER_PAN gesture instead, but I can't quite find a solution for this other than coding the entire animation by myself. Is there an easier way? Maybe some source code I couldn't find?

To summarize I want the TWO_FINGER_PAN gesture to do the exact same thing the PAN gesture would do.


Solution

  • When you disable a gesture, you have to handle the gesture on your side. There is no source code exposed for this as part of the HERE SDK. But you may want to look for native Android gesture handling examples.

    The Gestures example app that is shipped with the HERE SDK provides as least a starting point for custom gesture animations with the GestureAnimator class, but for a pan gesture you would usually not need any animation, so a finger movement relates to a change of the target coordinates of the MapView.