Package 

Interface MapPrimitiveEventGesture

  • All Implemented Interfaces:

    
    public interface MapPrimitiveEventGesture
    
                        

    Primitive (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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • 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 pixels
        y - 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 pixels
        y - 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 zoomStep indicates a zoom-in gesture.

        • A negative zoomStep indicates 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.4

        • Calculated newZoomLevel = 0.4 - 3 = -2.6 → exceeds minimum

        • Method adjusts zoomStep to 0.4 to clamp at Camera.MAP_MIN_ZOOM_LEVEL

        • zoomStep = -18 (zoom out)

        • currentZoomLevel = 17

        • Calculated newZoomLevel = 17 - (-18) = 35 → exceeds maximum

        • Method adjusts zoomStep to clamp at Camera.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.