-
- All Implemented Interfaces:
public interface MapPrimitiveEventGesturePrimitive (raw) gesture event controller for platform-agnostic map inputs. Receives the most primitive map gesture events (non-Android MotionEvent), suitable for Android Auto, embedded systems, or custom input devices.
-
-
Method Summary
Modifier and Type Method Description abstract BooleanonClick(Float x, Float y)Handles a single-click/tap event at the specified screen coordinates. abstract BooleanonLongClick(Float x, Float y)Handles a long-press event at the specified screen coordinates. abstract BooleanonTouchEvent(TouchEvent touchEvent, Float x, Float y)Handles touch events, used to process touch events from external sources. abstract BooleanonMultiTouchEvent(TouchEvent touchEvent, Float x1, Float y1, Float x2, Float y2)Handles multi-touch events, used to process touch events from external sources. abstract BooleanonZoomGestureEvent(Float zoomStep, Float x, Float y)Handles a zoom gesture at a specific screen position. -
-
Method Detail
-
onClick
abstract Boolean onClick(Float x, Float y)
Handles a single-click/tap event at the specified screen coordinates. This method is triggered when a quick tap gesture is detected on the screen. It should be used for primary actions like selection or activation of items at the touch location.
- Parameters:
x- The X coordinate of the touch point in view-relative pixelsy- The Y coordinate of the touch point in view-relative pixels
-
onLongClick
abstract Boolean onLongClick(Float x, Float y)
Handles a long-press event at the specified screen coordinates. This method is triggered when a sustained press is detected
- Parameters:
x- The X coordinate of the original touch down in view-relative pixelsy- The Y coordinate of the original touch down in view-relative pixels
-
onTouchEvent
abstract Boolean onTouchEvent(TouchEvent touchEvent, Float x, Float y)
Handles touch events, used to process touch events from external sources.
- Parameters:
touchEvent- The type of touch event, indicating the current state of the touch interaction.x- The X coordinate of the touch point, representing the horizontal position of the touch event.y- The Y coordinate of the touch point, representing the vertical position of the touch event.
-
onMultiTouchEvent
abstract Boolean onMultiTouchEvent(TouchEvent touchEvent, Float x1, Float y1, Float x2, Float y2)
Handles multi-touch events, used to process touch events from external sources.
- Parameters:
touchEvent- The type of touch event, indicating the current state of the touch interaction.x1- The X coordinate of the first touch point.y1- The Y coordinate of the first touch point.x2- The X coordinate of the second touch point.y2- The Y coordinate of the second touch point.
-
onZoomGestureEvent
abstract Boolean onZoomGestureEvent(Float zoomStep, Float x, Float y)
Handles a zoom gesture at a specific screen position.
This method simulates the effect of a pinch gesture by applying a zoom step centered at the given screen coordinates. It ensures the zoom level stays within the supported zoom bounds.
A positive
zoomStepindicates a zoom-in gesture.A negative
zoomStepindicates a zoom-out gesture.The method adjusts the step if it exceeds the min or max allowed zoom levels to prevent out-of-bound zooming.
zoomStep = 3(zoom in)currentZoomLevel = 0.4Calculated
newZoomLevel = 0.4 - 3 = -2.6→ exceeds minimumMethod adjusts
zoomStepto0.4to clamp atCamera.MAP_MIN_ZOOM_LEVELzoomStep = -18(zoom out)currentZoomLevel = 17Calculated
newZoomLevel = 17 - (-18) = 35→ exceeds maximumMethod adjusts
zoomStepto clamp atCamera.MAP_MAX_ZOOM_LEVEL
- Parameters:
zoomStep- The zoom change step.x- The X coordinate of the screen position where the gesture is centered.y- The Y coordinate of the screen position where the gesture is centered.
-
-
-
-