Class MapView.InteractionOptions

  • Enclosing class:
    MapView

    public static final class MapView.InteractionOptions
    extends GeoView.InteractionOptions
    Options to control user interactions with a MapView.
    Since:
    100.9.0
    • Constructor Detail

      • InteractionOptions

        public InteractionOptions​(MapView mapView)
        Constructs an instance of InteractionOptions for MapView.
        Parameters:
        mapView - the MapView to control
        Throws:
        java.lang.IllegalArgumentException - if mapView is null
        Since:
        100.9.0
    • Method Detail

      • isPanEnabled

        public boolean isPanEnabled()
        Indicates whether the user can pan the MapView or not. The default is true.
        Returns:
        true if the MapView can be panned, false otherwise
        Since:
        100.9.0
      • setPanEnabled

        public void setPanEnabled​(boolean panEnabled)
        Sets whether or not the user can pan the MapView. The default is true.
        Parameters:
        panEnabled - true to enable panning on the MapView, false otherwise
        Since:
        100.9.0
      • isRotateEnabled

        public boolean isRotateEnabled()
        Indicates whether the user can rotate the MapView or not. The default is true.
        Returns:
        true if the MapView can be rotated on the MapView, false otherwise
        Since:
        100.9.0
      • setRotateEnabled

        public void setRotateEnabled​(boolean rotateEnabled)
        Sets whether or not the user can rotate the MapView. The default is true.
        Parameters:
        rotateEnabled - true to enable rotating on the MapView, false otherwise
        Since:
        100.9.0
      • isZoomEnabled

        public boolean isZoomEnabled()
        Indicates whether the user can zoom on the MapView or not. The default is true.
        Returns:
        true if the MapView can be zoomed, false otherwise
        Since:
        100.9.0
      • setZoomEnabled

        public void setZoomEnabled​(boolean zoomEnabled)
        Sets whether or not the user can zoom on the MapView. The default is true.
        Parameters:
        zoomEnabled - true to enable zooming on the MapView, false otherwise
        Since:
        100.9.0
      • setMagnifierEnabled

        public void setMagnifierEnabled​(boolean magnifierEnabled)
        Sets whether or not the map magnifier is enabled. The default is false.

        When enabled, the magnifier is shown when you do a long-press on the MapView. The magnifier allows you to precisely position a location by centering its cross-hairs. To get the exact location of the final magnifier cross-hair location, you need to respond to the OnTouchListener.onUp() event.

        Parameters:
        magnifierEnabled - true to enable the magnifier, false otherwise
        Since:
        100.9.0
        See Also:
        canMagnifierPanMap()
      • isMagnifierEnabled

        public boolean isMagnifierEnabled()
        Indicates whether the map magnifier is enabled or not. The default is false.

        When enabled, the magnifier is shown when you do a long-press on the MapView.

        Returns:
        true if the magnifier is enabled, false otherwise
        Since:
        100.9.0
        See Also:
        canMagnifierPanMap()
      • setCanMagnifierPanMap

        public void setCanMagnifierPanMap​(boolean canMagnifierPanMap)
        Set whether or not the magnifier can pan the map when it touches the edge of the MapView. The default is false.
        Parameters:
        canMagnifierPanMap - true to allow the magnifier to pan the map, false otherwise
        Since:
        100.9.0
      • canMagnifierPanMap

        public boolean canMagnifierPanMap()
        Indicates whether the magnifier can pan the map or not when it touches the edge of the MapView. The default is false.
        Returns:
        true if the magnifier can pan the map, false otherwise
        Since:
        100.9.0
      • setSnapToNorthThreshold

        public void setSnapToNorthThreshold​(double threshold)
        Sets the threshold to snap to north when the map is rotated within the +/- threshold degrees off north.

        The threshold range is limited to 0 to 30 degrees. The default value is 7.5, it is disabled when it is set to 0.

        Parameters:
        threshold - the threshold to snap to north, in degrees
        Throws:
        java.lang.IllegalArgumentException - if threshold is not a valid number, or out of range 0 to 30
        Since:
        100.9.0
      • getSnapToNorthThreshold

        public double getSnapToNorthThreshold()
        Gets the threshold to snap to north.
        Returns:
        the threshold to snap to north, in degrees. The default is 7.5 degrees.
        Since:
        100.9.0