Hello again,

nevermind, figured it out.

just casting the map tool to QgsMapToolCapture does the trick:

from qgis.core import QgsPointXY from qgis.gui import QgsMapTool, QgsMapToolCapturefrom qgis.PyQt import sipmapToolCapture = sip.cast(iface.mapCanvas().mapTool(), QgsMapToolCapture) mapToolCapture.addVertex(QgsPointXY(1,2))


Cheers

Jonas

On 09.05.2019 12:55, Jonas wrote:
Hi,

is there a way to add vertices to the rubberband when the user currently digitizes a feature via the python API?

For example when adding a line feature, the user has already created a few vertices of a line via the rubber band. now i want to add the next vertex of that rubber band via python. I do NOT want to end the users action to create the feature, or add vertices to already existing features.

I think that would mean calling addVertex() on a QgsMapToolCapture-object. However i cannot find a way to retrieve a QgsMapToolCapture-object from the current mapTool.

Is there a way to do this?

Thanks

Jonas



_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to