[OpenLayers-Users] control.activate()

Steve.Toutant at inspq.qc.ca Steve.Toutant at inspq.qc.ca
Tue Jul 21 14:45:27 EDT 2009


Hi,
I don't know when I should and should not use the activate function when I 
create a control. My understanding was to use activate only when 
deactivate was called but I'm not sure.
Here are 2 examples copied from an openlayers example

var navControl = new OpenLayers.Control.Navigation({
                type: OpenLayers.Control.TYPE_TOGGLE,
                zoomWheelEnabled: true
 });
map.addControl(navControl);
navControl.activate();
 
var MousePosition = new OpenLayers.Control.MousePosition({element: 
$('mouseTrack')});
map.addControl(MousePosition);

Why call this? navControl.activate();
It seems to work even if I don,t use it.

And that works without .activate
map.addControl(MousePosition);

Thanks for clarifying this
Regards,
Steve


Steve Toutant, M. Sc.
Analyste en géomatique
Secteur environnement
Direction des risques biologiques, environnementaux et occupationnels
Institut national de santé publique du Québec
945, avenue Wolfe
Québec, Qc G1V 5B3 
Tél.: (418) 650-5115 #5281
Fax.: (418) 654-3144
steve.toutant at inspq.qc.ca
http://www.inspq.qc.ca
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090721/7e60d6a3/attachment.html


More information about the Users mailing list