[OpenLayers-Users] one control panel - mixed control types - how to disable all others

karsten karsten at terragis.net
Fri Sep 21 11:16:07 PDT 2012


For now found a solution that is working for me but seems that there should
be a better, more generic way of doing this. 
I wrote a function to just turn off all other active controls (see below),
but that I need now to put into every control handler function to switch off
other active control.  Using events , listeneeres and so forth there should
be a better way. How would you go about this ?
 
Cheers
Karsten
 
function deactivateToggleControls(){
   for (eachControl in customToolPanel.controls) {
        if (customToolPanel.controls[eachControl].active) {
           customToolPanel.controls[eachControl].deactivate();
        }
   }
}  


  _____  

From: karsten [mailto:karsten at terragis.net] 
Sent: Thursday, September 20, 2012 11:51 PM
To: 'openlayers-users at lists.osgeo.org'
Subject: one control panel - mixed control types - how to disable all others


Hi All,
 
I am not sure  if it expected behavior if you have a panel with multiple
controls, some Type 'Button' plus others such as Control.MeasureNew and
Control.MouseDefaults that the last two deactivate once the other is
clicked, but the button type controls won't deactivate then ?
For example when the user clicks son the 'MouseDefaults ' control then
'MeasureNew ' is deactivated (if it was active previously) , however
clicking on any of the button type controls does not deactivate 'MeasureNew'
 
So I was wondering what is the standard / or best way to have the button
controls when activated , deactivate all other controls ?
 
Cheers
Karsten
 

Karsten Vennemann
Principal

Terra GIS LTD
 <http://www.terragis.net/> www.terragis.net

 




=======
Email scanned by PC Tools - No viruses or spyware found.
(Email Guard: 9.0.0.2308, Virus/Spyware Database: 6.20640)
http://www.pctools.com/
=======
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120921/cd3d6ba9/attachment.html>


More information about the Users mailing list