[Qgis-user] getting QgsMapCanvasSnapper to work

2008-11-18 Thread Möri Cedric
Hi all! I'm trying to snap a vertex with my python plugin. (Many thanks to Martin for the quick work with the bindings!) My code looks like this: def canvasReleaseEvent(self,event): x = event.pos().x() y = event.pos().y() startingPoint = QPoint(x,y) result = [] e

Re: [Qgis-user] getting QgsMapCanvasSnapper to work

2008-11-18 Thread Stefanie Tellex
Here's what I do for snapping in python: def canvasReleaseEvent(self, e): print "mouse click", e mapcoords = self.canvas.getCoordinateTransform().toMapCoordinates(e.x(), e.y()) print "map position", mapcoords snapdist = 2 r = qgis_utils.snap(self.layer,

AW: [Qgis-user] getting QgsMapCanvasSnapper to work

2008-11-18 Thread Hugentobler Marco
on Möri Cedric Gesendet: Di 18.11.2008 18:43 An: qgis-user@lists.osgeo.org Betreff: [Qgis-user] getting QgsMapCanvasSnapper to work Hi all! I'm trying to snap a vertex with my python plugin. (Many thanks to Martin for the quick work with the bindings!) My code looks like this: def canv

Re: [Qgis-user] getting QgsMapCanvasSnapper to work

2008-11-18 Thread Carson Farmer
---Ursprüngliche Nachricht- > Von: [EMAIL PROTECTED] im Auftrag von Möri Cedric > Gesendet: Di 18.11.2008 18:43 > An: qgis-user@lists.osgeo.org > Betreff: [Qgis-user] getting QgsMapCanvasSnapper to work > > Hi all! > > I'm trying to snap a vertex with my pyth

Re: [Qgis-user] getting QgsMapCanvasSnapper to work

2008-11-19 Thread Martin Dobias
Hi, On Tue, Nov 18, 2008 at 11:00 PM, Hugentobler Marco <[EMAIL PROTECTED]> wrote: > Hi Cedric > > I used your code lines and started the debugger. It seems that the > QgsMapCanvasSnapper works correctly. I think the problem has to do with the > QList reference in the binding: > > int snapToCur

Re: [Qgis-user] getting QgsMapCanvasSnapper to work

2008-11-20 Thread Marco Hugentobler
Hi Martin Thanks a lot! It works for me now. Regards, Marco On Wednesday 19 November 2008 21:12:39 Martin Dobias wrote: > Hi, > > On Tue, Nov 18, 2008 at 11:00 PM, Hugentobler Marco > > <[EMAIL PROTECTED]> wrote: > > Hi Cedric > > > > I used your code lines and started the debugger. It seems th