[Users] Toolbar doesn't work with MORE than 6 control bottons

gbrun gbrun at myopera.com
Thu Aug 25 10:35:59 CEST 2011


I don't think too much buttons could be a problem. I have actually 8  
GeoExt Action buttons in my mapPanel toolbar! :s

Your problem may come rather from the last button you added, maybe the  
control linked to it?

Geoffrey


On Thu, 25 Aug 2011 10:28:35 +0200, Viola Anne <violaanne at gmail.com> wrote:

> Hi,
> Adding the 7th control to my toolbar causes the map not to display i.e  
> the
> map panel is blank. Any idea how to resolve this. Below is my code just
> incase someone can spot where am going wrong. Much thanks.
>
>
>   //Begin ToolBar
>          var ctrl, toolbarItems = [], action, actions = {};
>
> action = new GeoExt.Action({
>         control: new OpenLayers.Control.ZoomToMaxExtent(),
>         map: map,
>         text: "max extent",
>         //toggleGroup: "navControl",  //*** Leave off or disables button
> after zoom ***
>         allowDepress: false,
>         group: "navControl",
>         tooltip: "zoom to max extent",
>         iconCls: "zoomfull",
> height:"10px"
>     });
>     actions["max_extent"] = action;
>     toolbarItems.push(action);
>     toolbarItems.push("-");
>  // Pan Map
>     action = new GeoExt.Action({
>        // text: "nav",
>    text:"pan",
>         control: new OpenLayers.Control.Navigation(),
>         map: map,
>         // button options
>         toggleGroup: "navControl",
>         allowDepress: false,
>         pressed: true,
>         tooltip: "pan map",
>         // check item options
>         group: "navControl",
>         checked: true,
>         iconCls: "panMap"
>     });
>     actions["nav"] = action;
>     toolbarItems.push(action);
>  // Zoom In
>     action = new GeoExt.Action({
>         //text: "zoom box",
> text:"info",
>         control: new OpenLayers.Control.WMSGetFeatureInfo(),
>         map: map,
>         // button options
>         toggleGroup: "navControl",
>         allowDepress: false,
>         tooltip: "zoom box",
>         // check item options
>         group: "navControl",
>         iconCls: "zoomWindowIn"
>     });
>     actions["zoom_box"] = action;
>     toolbarItems.push(action);
>  //attribute Info
>  action = new GeoExt.Action({
> text: "attribute info",
> control: new OpenLayers.Control.WMSGetFeatureInfo(),
>             tooltip: 'Info',
>             map: map,
>             allowDepress: false,
>         tooltip: "zoom box",
>         // check item options
>         group: "info",
>         iconCls: "info"
>         });
>  actions["info"] = action;
>     toolbarItems.push(action);
>  //zoom out
>  action = new GeoExt.Action({
>         text:"zoom out",
>         control: new OpenLayers.Control.ZoomBox({out:true, displayClass:
> 'olControlZoomBoxOut'}),
>         map: map,
>         toggleGroup: "navControl",
>         allowDepress: false,
>         tooltip: "larger box, less zoom out",
>         group: "navControl",
>         iconCls: "zoomOut"
>     });
>     actions["zoom_out"] = action;
>     toolbarItems.push(action);
>     toolbarItems.push("-");
>  // Navigation history - two "button" controls
>     ctrl = new OpenLayers.Control.NavigationHistory();
>     map.addControl(ctrl);
>
>     action = new GeoExt.Action({
>         text: "previous",
>         control: new OpenLayers.Control.NavigationHistory().previous,
>         disabled: true,
>         tooltip: "previous in history"
>     });
>     actions["previous"] = action;
>     toolbarItems.push(action);
>
>     action = new GeoExt.Action({
>         text: "next",
>         control: new OpenLayers.Control.NavigationHistory().next,
>         disabled: true,
>         tooltip: "next in history"
>     });
>     actions["next"] = action;
>     toolbarItems.push(action);
>    toolbarItems.push("->");
>


-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/


More information about the Users mailing list