1

I am trying to display a vertex marker for a QGIS Python plugin I am writing. I am getting a the following error...

'NameError: global name 'QgsVertexMarker' is not defined'

canv = self.iface.mapCanvas()
canv.setExtent(rect)
marker = QgsVertexMarker(canv)
marker.setCenter(QgsPoint(x,y))
canv.refresh()

What am I doing wrong?

1 Answer 1

3

You just need to import it from the qgis.gui module

 from qgis.gui import QgsVertexMarker
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.