[Users] Toggle groups and select tool not working

Eric Lemoine eric.lemoine at camptocamp.com
Thu Oct 7 18:26:45 CEST 2010


On Thursday, October 7, 2010, Robert Buckley <robertdbuckley at yahoo.com> wrote:
> Hi,
>
> I have the following problem. I have a toolbar with a select tool enabling the
> user to click on a feature and get the popup info. Also on the toolbar there is
> a menu with measure tools (area/line).
> When I "F5" the select tool works ok with the other navigation tools. But as
> soon as I measure, the select tool doesn´t get activated again and stays a
> measure tool.
>
> Here is the project and the code for the select tool and measure tools is posted
> underneath.
>
> http://85.214.225.9:8080/geoserver/www/zgb_energie/index.html
>
> If anyone can see an error I´d be saving a few grey hairs.
>
> Thanks,
>
> Robert Buckley
>
>
> //select control
>          action = new GeoExt.Action({
>            text: "",
>          tooltip: "Features selektieren",
>          icon: '../images/information.png',
>          toggleGroup: toggleGroup,
>          group: 'toggleGroup',
>             control: new OpenLayers.Control.SelectFeature(
>         [layer_wea,layer_biogas,layer_wasserkraft,layer_kraftwerke],
>                 {
>
>                 }
>         ),
>           map: map
>          });
>     actions["Select"] = action;
>        toolbarItems.push(action);
>     toolbarItems.push(' ',' ',' ',' ');
>
>
>      // Measure area control
>           action = new GeoExt.Action({
>             text: "Flächen",
>           toggleGroup: toggleGroup,
>           group: 'toggleGroup',
>              control: new OpenLayers.Control.Measure(OpenLayers.Handler.Polygon,
> {
>              eventListeners: {
>              measure: function(evt) {
>             Ext.MessageBox.show(
>             {
>                 title: 'Flächenberechnung',
>                 buttons: Ext.MessageBox.OK,
>                 width: 200,
>                 msg: "Area: " + evt.measure.toFixed(2) + evt.units + "²",
>                 fn: check
>             });
>                     }
>             }
>             }),
>           map: map
>          });
>         actions["area"] = action;
>
>
>         // Measure line control
>          action = new GeoExt.Action({
>            text: "Entfernung",
>         toggleGroup: 'toggleGroup',
>         group: 'toggleGroup',
>             control: new OpenLayers.Control.Measure(OpenLayers.Handler.Path, {
>              eventListeners: {
>              measure: function(evt) {
>             Ext.MessageBox.show(
>             {title: 'Entfernung Messen'
>             ,buttons: Ext.MessageBox.OK
>             ,width:200
>             ,msg:"Entfernung: " + evt.measure.toFixed(2) + evt.units,
>             fn: check
>             });
>                     }
>             }
>             }),
>           map: map
>          });
>         actions["line"] = action;
>
>
>
>     toolbarItems.push({
>         text: "",
>         icon: '../images/ruler.png',
>         tooltip: "Messwerkzeuge",
>         toggleGroup: toggleGroup,
>         group: 'toggleGroup',
>         menu: new Ext.menu.Menu({
>
>             items: [
>              new Ext.menu.CheckItem(actions["area"]),
>              new Ext.menu.CheckItem(actions["line"])
>
>             ]
>
>         })
>     });


Hi,

See my latest email to Andrew Stewart. It's likely that you're hitting
the same issue.

Cheers,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com


More information about the Users mailing list