problem in using maptool

5 messages Options
Embed this post
Permalink
Arpita Singh

problem in using maptool

Reply Threaded More More options
Print post
Permalink

Hi,

I am new to QGIS, and I am trying to build an application.
I downloaded your tutorial it worked nicely even i was able to use ZoomFullExtent, ZoomPrevious.
but when I tried "qgsmaptoolidentify" it gave an error as:

File "E:\project\viewer.py", line 158, in __init__
self.toolIdentify = QgsMapToolIdentify(self.canvas)
NameError: global name 'QgsMapToolIdentify' is not defined
  
I used the above stated header as:

self.toolPan = QgsMapToolPan(self.canvas)
self.toolPan.setAction(self.mpActionPan)
self.toolIdentify = QgsMapToolIdentify(self.canvas)
self.toolIdentify.setAction(self.mpActionIdentify)
self.toolZoomIn = QgsMapToolZoom(self.canvas,False)
self.toolZoomIn.setAction(self.mpActionZoomIn)
self.toolZoomOut = QgsMapToolZoom(self.canvas, True)
self.toolZoomOut.setAction(self.mpActionZoomOut)

def pan(self):
    self.canvas.setMapTool(self.toolPan)
def zoomIn(self):
    self.canvas.setMapTool(self.toolZoomIn)
def zoomOut(self):
    self.canvas.setMapTool(self.toolZoomOut)
def zoomFull(self):
    self.canvas.zoomFullExtent()
def info_(self):
    self.canvas.setMapTool(self.toolIdentify)

Please help me by giving any idea.

thanks in advance

regards.
--
Arpita

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Mailing Lists-3

Re: problem in using maptool

Reply Threaded More More options
Print post
Permalink
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

Arpita Singh wrote:

> Hi,
>
> I am new to QGIS, and I am trying to build an application.
> I downloaded your tutorial it worked nicely even i was able to use
> ZoomFullExtent, ZoomPrevious.
> but when I tried "qgsmaptoolidentify" it gave an error as:
>
> File "E:\project\viewer.py", line 158, in __init__
> self.toolIdentify = QgsMapToolIdentify(self.canvas)
> NameError: global name 'QgsMapToolIdentify' is not defined
>


did you add an include for the qgsmaptoolidentify.h to the header?

Regards

Tim


> I used the above stated header as:
>
> self.toolPan = QgsMapToolPan(self.canvas)
> self.toolPan.setAction(self.mpActionPan)
> self.toolIdentify = QgsMapToolIdentify(self.canvas)
> self.toolIdentify.setAction(self.mpActionIdentify)
> self.toolZoomIn = QgsMapToolZoom(self.canvas,False)
> self.toolZoomIn.setAction(self.mpActionZoomIn)
> self.toolZoomOut = QgsMapToolZoom(self.canvas, True)
> self.toolZoomOut.setAction(self.mpActionZoomOut)
>
> def pan(self):
>     self.canvas.setMapTool(self.toolPan)
> def zoomIn(self):
>     self.canvas.setMapTool(self.toolZoomIn)
> def zoomOut(self):
>     self.canvas.setMapTool(self.toolZoomOut)
> def zoomFull(self):
>     self.canvas.zoomFullExtent()
> def info_(self):
>     self.canvas.setMapTool(self.toolIdentify)
>
> Please help me by giving any idea.
> thanks in advance
>
> regards.
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Qgis-developer mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/qgis-developer


- --

Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)
==============================================
Please do not email me off-list with technical
support questions. Using the lists will gain
more exposure for your issues and the knowledge
surrounding your issue will be shared with all.

Visit http://linfiniti.com to find out about:
 * QGIS programming and support services
 * Mapserver and PostGIS based hosting plans
 * FOSS Consulting Services
Skype: timlinux
Irc: timlinux on #qgis at freenode.net
==============================================

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkrirdIACgkQqk07qZdiYjeGDQCgkbSb05eQZqgI66dHaU7Mr5CG
eC8Anjdtfss6FKDIjI/zgYZFC+KJmQXZ
=MuPo
-----END PGP SIGNATURE-----
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Borys Jurgiel-2

Re: problem in using maptool

Reply Threaded More More options
Print post
Permalink
In reply to this post by Arpita Singh
Dne pátek 23 října 2009 12:40:30 Arpita Singh napsal(a):

> Hi,
>
> I am new to QGIS, and I am trying to build an application.
> I downloaded your tutorial it worked nicely even i was able to use
> ZoomFullExtent, ZoomPrevious.
> but when I tried "qgsmaptoolidentify" it gave an error as:
>
> File "E:\project\viewer.py", line 158, in __init__
> self.toolIdentify = QgsMapToolIdentify(self.canvas)
> NameError: global name 'QgsMapToolIdentify' is not defined

Unfortunately there's no python bindings for this tool. AFAIK you can either
use the QgsMapToolEmitPoint tool or build your own tool class on the abstract
QgsMapTool (the latter is what I would do - take the clickfu or profiletool
plugins as an example) and then use the coordinates to find features.
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Arpita Singh

Re: problem in using maptool

Reply Threaded More More options
Print post
Permalink
In reply to this post by Mailing Lists-3


Hi all,
 
I am using Qgis to build my application and i want to use QgsMapToolIdentify in python code.
 
I posted earlier also but I could not make use of the help given. can you help by giving any idea?
 
regarding I am coding in Python.
its urgent.
 
thanks in advance

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Bishwarup Banerjee

Re: problem in using maptool

Reply Threaded More More options
Print post
Permalink
Dear Arpita,

Can you please specify in detail, what you exactly wanted to do?
Is it that only identify tool is needed or you are thinking of customizing more on it.

Bye and take care

Bishwarup


On Tue, Nov 3, 2009 at 5:38 PM, Arpita Singh <[hidden email]> wrote:


Hi all,
 
I am using Qgis to build my application and i want to use QgsMapToolIdentify in python code.
 
I posted earlier also but I could not make use of the help given. can you help by giving any idea?
 
regarding I am coding in Python.
its urgent.
 
thanks in advance

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer



_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer