I'm using for my first time QgsMapCanvas()
and when I write my script and I then run it, I don't see anything in the canvas.
That's my script:
canva = QgsMapCanvas()
r = QgsRubberBand(canva,True)
points = [[QgsPointXY(607826.87000000011175871, 380922.09400000004097819),
QgsPointXY(607846.87000000011175871, 380922.09400000004097819),
QgsPointXY(607846.87000000011175871, 380952.09400000004097819)]]
r.setToGeometry(QgsGeometry.fromPolygonXY(points),None)
r.show()
canva.show()
Any help from you?
r
:r.setWidth(1)
andr.setColor(QColor(255, 0, 0))
, andcanva = iface.mapCanvas()
.