com.supermap.mapping.collector

Class Collector

  • java.lang.Object
    • com.supermap.mapping.collector.Collector


  • public class Collector
    extends java.lang.Object
    GPS GeometricObjectAcquisition class.
    Example:
    The following code demonstrates how to achieve GPS geometric object collection.
     Collector collector = mMapControl.getCollector();
            //get collector dataset
            Dataset dataset = mMapControl.getMap().getLayers().get(0).getDataset();
            collector.setDataset(dataset);
            //open GPS
            collector.openGPS();
            //create line 
            collector.createElement(GPSElementType.LINE);
            //setCollectorChangedListener
            collector.setCollectorChangedListener(new CollectionChangedListener() {
    • Method Detail

      • setMapView

        public void setMapView(MapView mapView)
        Sets the main control of the GPS GeometricObjectCollection Class association.
        Parameters:
        mapView - Main Control
      • setMapControl

        public void setMapControl(MapControl mapControl)
        Sets the map control.
        Parameters:
        mapControl - The map control.
      • setCollectionChangedListener

        public boolean setCollectionChangedListener(CollectionChangedListener listener)
        Sets positioning change listening.
        Parameters:
        listener - The positioning change listening.
        Returns:
        A boolean. Return true if successful; otherwise, false.
      • moveToCurrent

        public void moveToCurrent()
        Locate the map to the current location.
      • getGPSPoint

        public Point2D getGPSPoint()
        Get the current position.
        Returns:
        The current position of the GPS point.
      • setDataset

        public void setDataset(Dataset dataset)
        Sets the dataset used to store the collected data.
        Parameters:
        dataset - The dataset used to store the collected data.
      • createElement

        public boolean createElement(CollectorElement.GPSElementType type)
        Creates a collection object of the specified type.
        Parameters:
        type - Collection Object type.
        Returns:
        A boolean. Return true if successful; otherwise, false.
      • getCurGeometry

        public Geometry getCurGeometry()
        Gets the current geometry object.
        Returns:
        The geometrical object.
      • addGPSPoint

        public boolean addGPSPoint(Point2D pnt2D)
        Add points, GPS gets the points.
        Parameters:
        pnt2D - GPS gets the points.
        Returns:
        A boolean. Return true if successful; otherwise, false.
      • addGPSPoint

        public boolean addGPSPoint()
        Add points, GPS gets the points.
        Returns:
        A boolean. Return true if successful; otherwise, false.
      • showInfo

        public void showInfo(java.lang.String info)
        Display the prompt message.

        Center

        Parameters:
        info - The prompt message.
      • undo

        public void undo()
        Rollback.
      • redo

        public void redo()
        Redo.
      • setSingleTapEnable

        public void setSingleTapEnable(boolean enable)
        Sets whether or not to use gestures.
        Parameters:
        enable - A boolean,Return true if use gestures; otherwise, false.
      • IsSingleTapEnable

        public boolean IsSingleTapEnable()
        Sets whether or not to use gestures.
        Returns:
        A boolean. Return true if use gestures; otherwise, false.
      • setStyle

        public void setStyle(GeoStyle style)
        Sets the drawing style of the collection object.
        Parameters:
        style - The drawing style.
      • getStyle

        public GeoStyle getStyle()
        Gets the drawing style of the drawing Style collection object.
        Returns:
        The drawing style of the collection object.
      • openGPS

        public boolean openGPS()
        Open GPS
        Returns:
        Return true if open successful; otherwise false.
      • closeGPS

        public void closeGPS()
        Close GPS.
      • getElement

        public CollectorElement getElement()
        Gets the current collection object.
        Returns:
        The current collection object.
      • submit

        public boolean submit()
        Submit
        Returns:
        A boolean. Return true if submit successful; otherwise, false.
      • setEditNodeWidth

        public void setEditNodeWidth(double width)
        Sets the width of the current editing node, unit:10mm.
        Parameters:
        width - Edit the width of the node.
      • getEditNodeWidth

        public double getEditNodeWidth()
        Gets the width of the current editing node, unit:10mm.
        Returns:
        Edit the width of the node.
      • setEditNodeColor

        public void setEditNodeColor(int color)
        Sets the color of the currently editing node
        Parameters:
        color - the color of the currently editing node
      • setEditNodeColor

        public void setEditNodeColor(Color color)
        Sets the color of the currently editing node
        Parameters:
        color - the color of the currently editing node
      • getEditNodeColor

        public double getEditNodeColor()
        Gets the color of the currently editing node
        Returns:
        the color of the currently editing node
      • setNodeColor

        public void setNodeColor(Color color)
        Sets the node color.
        Parameters:
        color - The color of the node
      • setNodeColor

        public void setNodeColor(int color)
        Sets the node color.
        Parameters:
        color - The color of the node
      • getNodeColor

        public int getNodeColor()
        Gets the node color.
        Returns:
        The color of the node
      • setNodeSize

        public void setNodeSize(double width)
        Sets the node size.
        Parameters:
        width - The size of the node
      • getNodeSize

        public double getNodeSize()
        Gets the node size.
        Returns:
        The size of the node
      • isDragNodeEnable

        public boolean isDragNodeEnable()
        Gets whether the last note is movable. True means Yes.
        Returns:
        whether the last note is movable
      • setDragNodeEnable

        public void setDragNodeEnable(boolean bMove)
        Sets whether the last note is movable. True means Yes.
        Parameters:
        bMove - whether the last note is movable.