@@ -31,10 +31,12 @@ CoordinateCaptureMapTool::CoordinateCaptureMapTool(QgsMapCanvas* thepCanvas)
3131 : QgsMapTool(thepCanvas)
3232{
3333 // set cursor
34- QPixmap myIdentifyCursor = QPixmap ((const char **) identify_cursor );
34+ QPixmap myIdentifyCursor = QPixmap ((const char **) capture_point_cursor );
3535 mCursor = QCursor (myIdentifyCursor, 1 , 1 );
3636 mpMapCanvas = thepCanvas;
3737 mpRubberBand = new QgsRubberBand (mpMapCanvas,false ); // false - not a polygon
38+ mpRubberBand->setColor (Qt::red);
39+ mpRubberBand->setWidth (3 );
3840}
3941
4042CoordinateCaptureMapTool::~CoordinateCaptureMapTool ()
@@ -58,13 +60,15 @@ void CoordinateCaptureMapTool::canvasReleaseEvent(QMouseEvent * thepEvent)
5860 return ;
5961 }
6062
61- mpRubberBand->reset (false );
62-
63- // convert screen coordinates to map coordinates
6463 QgsPoint myPoint =
6564 mCanvas ->getCoordinateTransform ()->toMapCoordinates (thepEvent->x (), thepEvent->y ());
66- mpRubberBand->addPoint (myPoint,true ); // true - update canvas
6765 emit pointCaptured (myPoint);
66+ mpRubberBand->reset (false );
67+ // convert screen coordinates to map coordinates
68+ mpRubberBand->addPoint (myPoint,false ); // true - update canvas
69+ mpRubberBand->addPoint (myPoint,false ); // true - update canvas
70+ mpRubberBand->addPoint (myPoint,false ); // true - update canvas
71+ mpRubberBand->show ();
6872}
6973
7074
0 commit comments