Class PinchToZoomGestureDetector
- java.lang.Object
-
- com.esri.arcgisruntime.mapping.view.PinchToZoomGestureDetector
-
public final class PinchToZoomGestureDetector extends java.lang.Object
Implements a scale gesture detector for pinch-to-zoom gestures which can be used as an alternative toScaleGestureDetector
with theDefaultMapViewOnTouchListener
. Touch events need to be passed to theonTouchEvent(MotionEvent)
method, which determines if a pinch-to-zoom gesture is in progress, which will zoom the associated MapView in or out.- Since:
- 100.9.0
- See Also:
DefaultMapViewOnTouchListener.setPinchToZoomGestureDetector(PinchToZoomGestureDetector)
-
-
Constructor Summary
Constructors Constructor Description PinchToZoomGestureDetector(MapView mapView)
Creates a PinchToZoomGestureDetector with a MapView.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
onTouchEvent(android.view.MotionEvent event)
Determines if the specified motion event is part of a pinch-to-zoom gesture, in which case the associated MapView will be zoomed in or out depending on the current scale of the pinch gesture.
-
-
-
Constructor Detail
-
PinchToZoomGestureDetector
public PinchToZoomGestureDetector(MapView mapView)
Creates a PinchToZoomGestureDetector with a MapView.- Parameters:
mapView
- the MapView on which to apply pinch-to-zoom gestures- Throws:
java.lang.IllegalArgumentException
- if mapView is null- Since:
- 100.9.0
-
-
Method Detail
-
onTouchEvent
public boolean onTouchEvent(android.view.MotionEvent event)
Determines if the specified motion event is part of a pinch-to-zoom gesture, in which case the associated MapView will be zoomed in or out depending on the current scale of the pinch gesture. This method needs to be called when a touch event is dispatched to the associated MapView, typically this will be done by aView.OnTouchListener
which receives the touch events.- Parameters:
event
- the MotionEvent object containing information about the gesture- Returns:
- true if this gesture detector has consumed the event; false otherwise
- Since:
- 100.9.0
-
-