[Qgis-developer] Get starting point during add feature

Luigi Pirelli luipir at gmail.com
Fri Feb 27 13:49:37 PST 2015


derivate or use directly an instance of:

http://qgis.org/api/classQgsMapToolEmitPoint.html

every mapTool has methods to convert pixel coordinates in map (OTF) or
layer coordinates.

or

if you want to piggyback qgis editing, attach the editing signal of
the QgsVectorLayer or that of the QgsVectorLayerEditBuffer.

avoid using editing with dataProvider otherwise no event will be emitted.

regards, Luigi Pirelli

On 27 February 2015 at 16:20, francescoboccacci at libero.it
<francescoboccacci at libero.it> wrote:
> Hi all,
> I'm writing a plugin and i would like to get the first (starting point)
> vertex of a line vector feature  during editing.
> The steps are:
> 1) enable a line vector to be editable
> 2)click on add feature button
> 3)When i click on mapcanvas to draw my first point, i would like to get the
> point and convert it into mapcoordinate
>
> The scope of it is to add a feature (point feature - starting point) to a
> test point layer so i can 'Autosnap' my drawing feature to the starting
> point.
> Anyone can help me?
>
> Thanks
>
> Francesco
>
>
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the Qgis-developer mailing list