[Users] ToggleGroup problem

Robert Buckley robertdbuckley at yahoo.com
Tue Oct 5 15:45:53 CEST 2010


Hi

This is the code for a toolbar which contains the standard Webmapping functions 
with a  Measure tool(area/line), Zoombox, Pan, and Select button.

When I first load the map, the pan is activated with the standard pan mouse 
icon.
When I press the select button, this works as expected, but when I pan again, 
the pan "cross" icon has gone.

If I now zoom, I cannot pan or Select anymore.
If I measure a line, it sticks with "line measure"...but if I measure "area" it 
sticks with that and no others tools can be used. I am assuming that
there is a conflict with openlayers but I´m not sure where to look.

Any help is much appreciated.


var toggleGroup = "ToogleToolbar";


        

        var lengthButton = new Ext.Button({
            text: 'Länge',
            icon: '../images/ruler.png',
            enableToggle: true,
            toggleGroup: toggleGroup,
            handler: function(toggled){
                if (toggled) {
                    length.activate();
                } else {
                    length.deactivate();
                }
            }
        });
        
        var areabutton = new Ext.Button({
            text: 'Areal',
            icon: '../images/ruler_square.png',
            enableToggle: true,
            toggleGroup: toggleGroup,
            handler: function(toggled){
                if (toggled) {
                    area.activate();
                } else {
                    area.deactivate();
                }
            }
        });
        
    
        var panbutton = new Ext.Button({
            text: 'Pan',
            icon: '../images/pan.png',
            enableToggle: true,
            toggleGroup: toggleGroup,
            handler: function(toggled){
                if (toggled) {
                    oDragPanCtrl.activate();
                } else {
                    oDragPanCtrl.deactivate();
                }
            }
        });
            
            
    var  zoomboxbutton = new Ext.Button({
            text: 'Zoom',
            icon: '../images/zoombox.png',
            enableToggle: true,
            toggleGroup: toggleGroup,
            handler: function(toggled){
                if (toggled) {
                    zoombox.activate();
                } else {
                    zoombox.deactivate();
                }
            }    
        });
    var selectbutton = new Ext.Button({
            text: "Feature Info",
            icon: '../images/information.png',
            enableToggle: true,
            toggleGroup: toggleGroup,
            handler: function(toggled){
                if (toggled) {
                    featureInfo.activate();    
                } else {   
                    featureInfo.deactivate();    
                }
            }  
        });




More information about the Users mailing list