Skip to content

Commit

Permalink
Add method to retrieve QgsVertexMarker center point in map coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 8, 2021
1 parent 2ffc306 commit 0d785c8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
14 changes: 14 additions & 0 deletions python/gui/auto_generated/qgsvertexmarker.sip.in
Expand Up @@ -46,6 +46,20 @@ A class for marking vertices of features using e.g. circles or 'x'.
QgsVertexMarker( QgsMapCanvas *mapCanvas /TransferThis/ ); QgsVertexMarker( QgsMapCanvas *mapCanvas /TransferThis/ );


void setCenter( const QgsPointXY &point ); void setCenter( const QgsPointXY &point );
%Docstring
Sets the center ``point`` of the marker, in map coordinates.

.. seealso:: :py:func:`center`
%End

QgsPointXY center() const;
%Docstring
Returns the center point of the marker, in map coordinates.

.. seealso:: :py:func:`setCenter`

.. versionadded:: 3.18
%End


void setIconType( int iconType ); void setIconType( int iconType );


Expand Down
13 changes: 13 additions & 0 deletions src/gui/qgsvertexmarker.h
Expand Up @@ -61,8 +61,21 @@ class GUI_EXPORT QgsVertexMarker : public QgsMapCanvasItem


QgsVertexMarker( QgsMapCanvas *mapCanvas SIP_TRANSFERTHIS ); QgsVertexMarker( QgsMapCanvas *mapCanvas SIP_TRANSFERTHIS );


/**
* Sets the center \a point of the marker, in map coordinates.
*
* \see center()
*/
void setCenter( const QgsPointXY &point ); void setCenter( const QgsPointXY &point );


/**
* Returns the center point of the marker, in map coordinates.
*
* \see setCenter()
* \since QGIS 3.18
*/
QgsPointXY center() const { return mCenter; }

void setIconType( int iconType ); void setIconType( int iconType );


void setIconSize( int iconSize ); void setIconSize( int iconSize );
Expand Down

0 comments on commit 0d785c8

Please sign in to comment.