public interface MapGesture
Default gestures made available through this interface include:
Various setter methods of this interface allow an application developer to set specific gestures
as either enabled or disabled. There is also a setAllGesturesEnabled(boolean)
method
which simultaneously enables or disables all gestures.
Note: the default functionality of one or more gestures can be customized by implementing the
MapGesture.OnGestureListener
class and overriding appropriate methods to define desired gesture
functionality (this must be done to make use of the long press gesture).
Modifier and Type | Interface and Description |
---|---|
static interface |
MapGesture.OnGestureListener
Event Listener interface for gesture events.
|
Modifier and Type | Method and Description |
---|---|
void |
addOnGestureListener(MapGesture.OnGestureListener listener)
Adds a
MapGesture.OnGestureListener to listen for map gesture events. |
void |
cancelKineticPanning()
Cancels all currently active motions caused by kinetic panning.
|
boolean |
isAutoSnapToNorthEnabled()
Returns a boolean value indicating whether map automatically rotates to the north
if previous rotation did not exceed certain small amount of degrees starting from north.
|
boolean |
isDoubleTapEnabled()
Returns a boolean value indicating whether double-tap is enabled for the
MapGesture . |
boolean |
isFixedMapCenterOnMapRotateZoom()
Returns a boolean value indicating whether the transform center is applied on rotate and zoom
interactions.
|
boolean |
isKineticFlickEnabled()
Returns a boolean value indicating whether flick-to-scroll (with kinetic momentum) is enabled
for the
MapGesture . |
boolean |
isLongPressEnabled()
Returns a boolean value indicating whether long-press is enabled for this
MapGesture . |
boolean |
isPanningEnabled()
Returns a boolean value indicating whether panning is enabled for this
MapGesture . |
boolean |
isPinchEnabled()
Returns a boolean value indicating whether pinch is enabled for this
MapGesture . |
boolean |
isRotateEnabled()
Returns a boolean value indicating whether two-finger rotation is enabled for this
MapGesture . |
boolean |
isSingleTapEnabled()
Returns a boolean value indicating whether single-tap is enabled for this
MapGesture . |
boolean |
isTiltEnabled()
Returns a boolean value indicating whether tilt is enabled for this
MapGesture . |
boolean |
isTwoFingerPanningEnabled()
Returns a boolean value indicating whether two-finger panning interactions are enabled for
this
MapGesture . |
boolean |
isTwoFingerTapEnabled()
Returns a boolean value indicating whether two-finger tap is enabled for this
MapGesture . |
void |
removeOnGestureListener(MapGesture.OnGestureListener listener)
Removes an existing
MapGesture.OnGestureListener . |
MapGesture |
setAllGesturesEnabled(boolean enabled)
Sets all possible kinds of gesture interaction to be either enabled or disabled for the
MapGesture . |
MapGesture |
setAutoSnapToNorthEnabled(boolean enabled)
Sets whether map automatically rotates to the north if previous rotation did not exceed
certain small amount of degrees starting from north.
|
MapGesture |
setDoubleTapEnabled(boolean enabled)
Sets whether double-tap interactions are enabled or disabled for this
MapGesture . |
MapGesture |
setFixedMapCenterOnMapRotateZoom(boolean lock)
Sets whether the transform center is applied during multitouch gestures.
|
MapGesture |
setKineticFlickEnabled(boolean enabled)
Sets whether flick-to-scroll (with kinetic momentum) interactions are enabled for this
MapGesture . |
MapGesture |
setLongPressEnabled(boolean enabled)
Sets whether long-press interactions are enabled or disabled for this
MapGesture . |
MapGesture |
setPanningEnabled(boolean enabled)
Sets panning interactions to be either enabled or disabled for this
MapGesture . |
MapGesture |
setPinchEnabled(boolean enabled)
Sets whether pinch interactions are enabled or disabled for this
MapGesture . |
MapGesture |
setRotateEnabled(boolean enabled)
Sets whether two-finger rotate interactions are enabled for this
MapGesture . |
MapGesture |
setSingleTapEnabled(boolean enabled)
Sets whether single-tap interactions are enabled or disabled for this
MapGesture . |
MapGesture |
setTiltEnabled(boolean enabled)
Sets whether tilt interactions are enabled or disabled for this
MapGesture . |
MapGesture |
setTwoFingerPanningEnabled(boolean enable)
Sets whether the two-finger panning interaction is enabled for this
MapGesture . |
MapGesture |
setTwoFingerTapEnabled(boolean enabled)
Sets whether two-finger tap gestures are enabled or disabled for this
MapGesture . |
void addOnGestureListener(MapGesture.OnGestureListener listener)
MapGesture.OnGestureListener
to listen for map gesture events. When there are multiple
listeners subscribed to the MapGesture
events, the order when a subscriber receives a
callback is determined by the order when they are added to MapGesture
.
It is important that after adding an MapGesture.OnGestureListener
in an user application,
remember to call removeOnGestureListener(OnGestureListener)
when there's no longer a
need to listen for map gesture events to free up application resources.
listener
- A MapGesture.OnGestureListener
to add to this MapGesture
removeOnGestureListener(OnGestureListener)
void removeOnGestureListener(MapGesture.OnGestureListener listener)
MapGesture.OnGestureListener
. Call this method to free up application
resources when there's no longer any need to listen for map gesture events.listener
- A MapGesture.OnGestureListener
to remove from this MapGesture
MapGesture setPanningEnabled(boolean enabled)
MapGesture
.
Note that when panning is disabled, kinetic panning will also be blocked, even if it is
enabled.enabled
- A boolean specifying whether panning is enabledMapGesture
itself.boolean isPanningEnabled()
MapGesture
. By
default, this value is set to true.MapGesture setKineticFlickEnabled(boolean enabled)
MapGesture
.enabled
- A boolean specifying whether kinetic flick is enabledMapGesture
itself.boolean isKineticFlickEnabled()
MapGesture
. By default, this value is set to true.MapGesture setPinchEnabled(boolean enabled)
MapGesture
.enabled
- A boolean
specifying whether pinch is enabledMapGesture
itself.boolean isPinchEnabled()
MapGesture
. By
default, this value is set to true.MapGesture setRotateEnabled(boolean enabled)
MapGesture
.enabled
- A boolean specifying whether rotate is enabledMapGesture
itself.boolean isRotateEnabled()
MapGesture
. By default, this value is set to true.MapGesture setAutoSnapToNorthEnabled(boolean enabled)
enabled
- A boolean specifying whether auto snap to north is enabled.MapGesture
itself.boolean isAutoSnapToNorthEnabled()
MapGesture setTiltEnabled(boolean enabled)
MapGesture
.enabled
- A boolean specifying whether tilt is enabledMapGesture
itself.boolean isTiltEnabled()
MapGesture
. By
default, this value is set to true.MapGesture setSingleTapEnabled(boolean enabled)
MapGesture
.enabled
- A boolean specifying whether single-tap is enabledMapGesture
itself.boolean isSingleTapEnabled()
MapGesture
.
By default, this value is set to true.MapGesture setDoubleTapEnabled(boolean enabled)
MapGesture
.enabled
- A boolean specifying whether double-tap is enabledMapGesture
itself.boolean isDoubleTapEnabled()
MapGesture
.
By default, this value is set to true.MapGesture setLongPressEnabled(boolean enabled)
MapGesture
.enabled
- A boolean specifying whether long-press is enabledMapGesture
itself.boolean isLongPressEnabled()
MapGesture
.
By default, this value is set to true.MapGesture setTwoFingerTapEnabled(boolean enabled)
MapGesture
.enabled
- A boolean specifying whether two-finger tap is enabledMapGesture
itself.boolean isTwoFingerTapEnabled()
MapGesture
. By default, this value is set to true.MapGesture setAllGesturesEnabled(boolean enabled)
MapGesture
.enabled
- A boolean specifying whether all gestures are enabledMapGesture
itself.MapGesture setTwoFingerPanningEnabled(boolean enable)
MapGesture
.enable
- True if two finger panning will be enabled (default). False if two-finger panning
will not be enabled.MapGesture
itself.boolean isTwoFingerPanningEnabled()
MapGesture
. By default, this value is set to true.MapGesture setFixedMapCenterOnMapRotateZoom(boolean lock)
lock
- A boolean specifying whether transform center is fixed . Default is falseMapGesture
itself.boolean isFixedMapCenterOnMapRotateZoom()
void cancelKineticPanning()