mirror of
https://github.com/qgis/QGIS.git
synced 2025-11-22 00:14:55 -05:00
Don't force a vector layer to be used for QgsRubberBand::addGeometry
There's no reason to restrict this call solely to vector layers -- it's useful to have accessible for adding geometries associated with other layer types too.
This commit is contained in:
parent
84247cb51e
commit
d43c575ff3
@ -281,7 +281,7 @@ Copies the points from another rubber band.
|
||||
.. versionadded:: 3.22
|
||||
%End
|
||||
|
||||
void addGeometry( const QgsGeometry &geometry, QgsVectorLayer *layer, bool doUpdate = true );
|
||||
void addGeometry( const QgsGeometry &geometry, QgsMapLayer *layer, bool doUpdate = true );
|
||||
%Docstring
|
||||
Adds the geometry of an existing feature to a rubberband
|
||||
This is useful for multi feature highlighting.
|
||||
@ -293,8 +293,7 @@ If additional geometries are to be added then set ``doUpdate`` to ``False`` to d
|
||||
After adding the final geometry :py:func:`~QgsRubberBand.updatePosition` should be called.
|
||||
|
||||
:param geometry: the geometry object. Will be treated as a collection of vertices.
|
||||
:param layer: the layer containing the feature, used for coord transformation to map
|
||||
crs. If ``layer`` is ``None``, the coordinates are not going to be transformed.
|
||||
:param layer: the layer associated with the geometry. This is used for transforming the geometry from the layer's CRS to themap crs. If ``layer`` is ``None`` no coordinate transformation will occur.
|
||||
:param doUpdate: set to ``False`` to defer updates of the rubber band.
|
||||
%End
|
||||
|
||||
|
||||
@ -284,7 +284,7 @@ void QgsRubberBand::setToGeometry( const QgsGeometry &geom, const QgsCoordinateR
|
||||
addGeometry( geom, crs );
|
||||
}
|
||||
|
||||
void QgsRubberBand::addGeometry( const QgsGeometry &geometry, QgsVectorLayer *layer, bool doUpdate )
|
||||
void QgsRubberBand::addGeometry( const QgsGeometry &geometry, QgsMapLayer *layer, bool doUpdate )
|
||||
{
|
||||
QgsGeometry geom = geometry;
|
||||
if ( layer )
|
||||
|
||||
@ -337,11 +337,10 @@ class GUI_EXPORT QgsRubberBand : public QgsMapCanvasItem
|
||||
* After adding the final geometry updatePosition() should be called.
|
||||
*
|
||||
* \param geometry the geometry object. Will be treated as a collection of vertices.
|
||||
* \param layer the layer containing the feature, used for coord transformation to map
|
||||
* crs. If \a layer is NULLPTR, the coordinates are not going to be transformed.
|
||||
* \param layer the layer associated with the geometry. This is used for transforming the geometry from the layer's CRS to themap crs. If \a layer is NULLPTR no coordinate transformation will occur.
|
||||
* \param doUpdate set to FALSE to defer updates of the rubber band.
|
||||
*/
|
||||
void addGeometry( const QgsGeometry &geometry, QgsVectorLayer *layer, bool doUpdate = true );
|
||||
void addGeometry( const QgsGeometry &geometry, QgsMapLayer *layer, bool doUpdate = true );
|
||||
|
||||
/**
|
||||
* Adds a \a geometry to the rubberband.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user