How to deactivate drag event in OpenLayers Map

2 messages Options
Embed this post
Permalink
David Alda Fernandez de Lezea

How to deactivate drag event in OpenLayers Map

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
Hello,
 
I want to deactivate the drag event in the following scenario. I've a tool that selects features from a WFS server, and I want to deactivate the drag event while you are selecting features, because if you move the mouse a bit while trying to select a feature, the feature is not selected and the map is moved to the draggd zone. I hope I've explained the problem properly. Is this possible??
 
In my selecting tool 'Select event' I tried something like this but it didn't work:
 
map.events.unregister('drag', map, stopDragEvent);
 
Does anybody know how to achieve this goal??
 
Thanks.
 

 

 

Un saludo,

 

··················································································

David Alda Fernández de Lezea

Lurralde eta Biodibertsitate Saila / Dpto. de Territorio y Biodiversidad

 

IKT

Granja Modelo s/n · 01192 · Arkaute (Araba)


··················································································
Tlfnos.: 945-00-32-95                         Fax: 945-00.32.90
··················································································
email: [hidden email]                                web: www.ikt.es
··················································································



_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users

logo.gif (1K) Download Attachment
David Alda Fernandez de Lezea

Re: How to deactivate drag event in OpenLayers Map

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
Hello,
 
I manage to deactivate drag and zooming events by using this code:
 
for (var i = 0; i< map.controls.length; i++) {
     if (map.controls[i].displayClass == "olControlNavigation") {
          map.controls[i].deactivate();
     }
}
 
Hope this can be helpful.
 
Regards.

 

Un saludo,

 

··················································································

David Alda Fernández de Lezea

Lurralde eta Biodibertsitate Saila / Dpto. de Territorio y Biodiversidad

 

IKT

Granja Modelo s/n · 01192 · Arkaute (Araba)


··················································································
Tlfnos.: 945-00-32-95                         Fax: 945-00.32.90
··················································································
email: [hidden email]                                web: www.ikt.es
··················································································

 


De: [hidden email] [mailto:[hidden email]] En nombre de David Alda Fernandez de Lezea
Enviado el: miércoles, 04 de noviembre de 2009 9:29
Para: [hidden email]
Asunto: [OpenLayers-Users] How to deactivate drag event in OpenLayers Map

Hello,
 
I want to deactivate the drag event in the following scenario. I've a tool that selects features from a WFS server, and I want to deactivate the drag event while you are selecting features, because if you move the mouse a bit while trying to select a feature, the feature is not selected and the map is moved to the draggd zone. I hope I've explained the problem properly. Is this possible??
 
In my selecting tool 'Select event' I tried something like this but it didn't work:
 
map.events.unregister('drag', map, stopDragEvent);
 
Does anybody know how to achieve this goal??
 
Thanks.
 

 

 

Un saludo,

 

··················································································

David Alda Fernández de Lezea

Lurralde eta Biodibertsitate Saila / Dpto. de Territorio y Biodiversidad

 

IKT

Granja Modelo s/n · 01192 · Arkaute (Araba)


··················································································
Tlfnos.: 945-00-32-95                         Fax: 945-00.32.90
··················································································
email: [hidden email]                                web: www.ikt.es
··················································································



_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users

logo.gif (1K) Download Attachment