@@ -31,10 +31,12 @@ CoordinateCaptureMapTool::CoordinateCaptureMapTool(QgsMapCanvas* thepCanvas)
31
31
: QgsMapTool(thepCanvas)
32
32
{
33
33
// set cursor
34
- QPixmap myIdentifyCursor = QPixmap ((const char **) identify_cursor );
34
+ QPixmap myIdentifyCursor = QPixmap ((const char **) capture_point_cursor );
35
35
mCursor = QCursor (myIdentifyCursor, 1 , 1 );
36
36
mpMapCanvas = thepCanvas;
37
37
mpRubberBand = new QgsRubberBand (mpMapCanvas,false ); // false - not a polygon
38
+ mpRubberBand->setColor (Qt::red);
39
+ mpRubberBand->setWidth (3 );
38
40
}
39
41
40
42
CoordinateCaptureMapTool::~CoordinateCaptureMapTool ()
@@ -58,13 +60,15 @@ void CoordinateCaptureMapTool::canvasReleaseEvent(QMouseEvent * thepEvent)
58
60
return ;
59
61
}
60
62
61
- mpRubberBand->reset (false );
62
-
63
- // convert screen coordinates to map coordinates
64
63
QgsPoint myPoint =
65
64
mCanvas ->getCoordinateTransform ()->toMapCoordinates (thepEvent->x (), thepEvent->y ());
66
- mpRubberBand->addPoint (myPoint,true ); // true - update canvas
67
65
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 ();
68
72
}
69
73
70
74
0 commit comments