com.supermap.mapping

Class SnapSetting



  • public class SnapSetting
    extends InternalHandleDisposable
    The snap settings of the map control

    The priority of snap mode is determined by the order of the snap mode in this object. The modes ahead have higher priority.

    Example:
    Sample Codes:
         SnapSetting snapSetting = new SnapSetting();     // Create the snap setting object
         snapSetting.openAll();                           // Open all snap modes
         snapSetting.set(SnapMode.POINT_ON_LINE, false);  // Close point on line snapping, and the close way is the similar
         
         mapControl.setSnapSetting(snapSetting);          // Snap setting by MapControl
     
    • Constructor Detail

      • SnapSetting

        public SnapSetting()
        The constructor.
      • SnapSetting

        public SnapSetting(SnapSetting setting)
        The constructor. Create new object by source object.
        Parameters:
        setting - Snap settings.
    • Method Detail

      • getMaxSnappedCount

        public int getMaxSnappedCount()
        Get the max count of snap.
        Returns:
        the max count of snap.
      • setMaxSnappedCount

        public void setMaxSnappedCount(int value)
        Set the max count of snap.
        Parameters:
        value - The maximum captured number which ranges from 20 to 5000. 500 is by default
      • get

        public boolean get(SnapMode mode)
        Get a snap mode whether to start
        Parameters:
        mode - The snap mode.
        Returns:
        Whether to start.
      • set

        public void set(SnapMode mode,
                        boolean value)
        Set a snap mode whether to start
        Parameters:
        mode - The snap mode.
        value - true means open, false means close
      • openAll

        public void openAll()
        Enable all snap functions, 4 functions.
      • closeAll

        public void closeAll()
        Close all snap functions, 4 functions.
      • openDefault

        public void openDefault()
        Open the default snap function. By default, the node, end and line snapping are opened at the same time.
      • dispose

        public void dispose()
        Releases the object.
      • getTolerance

        public int getTolerance()
        Get the snap tolerance.
        Returns:
        Snap tolerance
      • setTolerance

        public void setTolerance(int value)
        Set snap tolerance
        Parameters:
        value - Snap tolerance.