Hi, GeoExt has a GeoExt.Action class for adapting OpenLayers controls as Ext buttons. You should use them instead of defining your own Ext.Action. See in the following example :
http://dev.geoext.org/trunk/geoext/examples/toolbar.html Regards, Alexandre On 10-10-05 09:45 AM, Robert Buckley wrote: > 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(); > } > } > }); > > > _______________________________________________ > Users mailing list > [email protected] > http://www.geoext.org/cgi-bin/mailman/listinfo/users > -- Alexandre Dubé Mapgears www.mapgears.com _______________________________________________ Users mailing list [email protected] http://www.geoext.org/cgi-bin/mailman/listinfo/users
