[Users] Toolbar in GeoEXT Center Panel Not Rendering

Andrew Parker andrew at source3.com
Mon Jan 31 04:06:57 CET 2011


Note: Sorry for the double post form the OpenLayers User List.  I must 
have had a momentary lapse of reason for not posting here first.

It has been a couple of years since I create my first OpenLayers/MapFish 
application (http://pitrule.source3.com).  It is time to expand the 
application to a larger region and I would like to make some changes. 
  Note: I created my first application without fully understanding how 
OpenLayers/MapFish worked.

Therefore, I am going back to learning the basics as I am learning how 
to program.  I was able to create a basic GeoExt/OpenLayers map with a 
toolbar (http://saturn.nmt.edu/national/measure.html).  Now I am trying 
to add the toolbar to the center region of a three panel layout 
(http://saturn.nmt.edu/national/tree.html).  I finally resolved all the 
configuration errors.  However, I cannot get the toolbar to render in 
the center panel.

Any help with this is very much appreciated.

Portion of the tree.js code is:

//Start of javascript for GeoEXT/OpenLayers Tree Example

var mapPanel, tree, map1;
// Toolbar Variables
var ctrl, toolbarItems = [], action, actions = {};

Ext.onReady(function() {
     Ext.QuickTips.init();
     mapPanel = new GeoExt.MapPanel({
         border: true,
         region: "center",
         map: map1 = new OpenLayers.Map({allOverlays: false}),  // had 
to add "map1=" for toolbar
         center: [146.1569825, -41.6109735],
         zoom: 6,
         layers: [
             new OpenLayers.Layer.WMS("Global Imagery",
         ...
         ],
         tbar: [toolbarItems]
         // WHEN items IS USED, MAP DOES NOT DISPLAY
         //  items: [{
         //    xtype: "gx_mappanel",
         //    tbar: [toolbarItems]
         //  }]
     });
...
/********* Create Toobar Buttons   *************/
     // Zoom to extent
     action = new GeoExt.Action({
         control: new OpenLayers.Control.ZoomToMaxExtent(),
         map: map1,
         text: "max extent",
         // toggleGroup: "navControl",  *** Leave off or disables button 
after zoom ***
         allowDepress: false,
         group: "navControl",
         tooltip: "zoom to max extent",
         iconCls: "zoomfull"
     });
     actions["max_extent"] = action;
     toolbarItems.push(action);
     toolbarItems.push("-");
...
});

Please recall the full code can be viewed at: 
http://saturn.nmt.edu/national/tree.html

Thanks,

-- 
Andrew Parker
Source3 Computing, LLC




More information about the Users mailing list