<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Arial, sans-serif" size="2">
<div>I am trying to use a GeoExt.Action with an Ext.Toolbar to perform actions on my map with openlayers controls using the example located here - <a href="http://www.geoext.org/lib/GeoExt/widgets/Action.html"><font color="#0000FF"><u>http://www.geoext.org/lib/GeoExt/widgets/Action.html</u></font></a></div>
<div> </div>
<div>Unfortunately my buttons are not working, as when I click on the zoom in ./ zoom out action buttons I created the control is not activated for my map. I am thinking this is because of my layout using a mappanel but I just can't figure out how to get the
controls added to the map properly since I was using a working OpenLayers control panel before. Any help greatly appreciated, here is my code -</div>
<div> </div>
<div> </div>
<div>// -------------------------------------------------- END Define Map Layers ---------------------------------</div>
<div> </div>
<div> var map;</div>
<div> var startupLat;</div>
<div> var startupLon;</div>
<div> var lonLat;</div>
<div> var startupLevel;</div>
<div> </div>
<div> </div>
<div> // begin map defintion</div>
<div> map = new OpenLayers.Map('map',{controls: [],</div>
<div> //scales: [974000,1867000,3300000,4450000,7075000,14513000,25769000,35654000,58981000,100000000],</div>
<div> maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34),</div>
<div> maxResolution: 156543.0399,</div>
<div> numZoomLevels: 20,</div>
<div> units: 'km',</div>
<div> projection: new OpenLayers.Projection("EPSG:900913"),</div>
<div> displayProjection: new OpenLayers.Projection("EPSG:4326")</div>
<div> }); //end of map definition </div>
<div> </div>
<div> </div>
<div> //Declare 3 Panels for left menu - Themes Panel, Legend Panel and Overview Panel</div>
<div> </div>
<div> </div>
<div> var panel_Map = new GeoExt.MapPanel({</div>
<div> collapsed: false,</div>
<div> height: 800,</div>
<div> renderTo: 'map',</div>
<div> map: map,</div>
<div> center: lonLat,</div>
<div> zoom: startupLevel</div>
<div> });</div>
<div> </div>
<div> </div>
<div> //Define GeoEXT Actions for each Toolbar Button</div>
<div> </div>
<div> var action_home = new GeoExt.Action({</div>
<div> text: '&nbsp;&nbsp;Home',</div>
<div> cls: 'x-btn-text-icon',</div>
<div> icon: '../images/toolbar/home.gif',</div>
<div> handler: function(){window.location.reload();},</div>
<div> map: map</div>
<div> });</div>
<div> var action_query = new GeoExt.Action({</div>
<div> text: '&nbsp;&nbsp;Queries',</div>
<div> cls: 'x-btn-text-icon',</div>
<div> icon: '../images/toolbar/query.gif',</div>
<div> handler: function() {document.getElementById('show-btn').click();},</div>
<div> map: map</div>
<div> });</div>
<div> var action_zoomin = new GeoExt.Action({</div>
<div> text: '&nbsp;&nbsp;Zoom In',</div>
<div> cls: 'x-btn-text-icon',</div>
<div> icon: '../images/toolbar/zoomin.gif',</div>
<div> control: new OpenLayers.Control.ZoomBox(),</div>
<div> map: map</div>
<div> });</div>
<div> var action_zoomout = new GeoExt.Action({</div>
<div> text: '&nbsp;&nbsp;Zoom Out',</div>
<div> cls: 'x-btn-text-icon',</div>
<div> icon: '../images/toolbar/zoomout.gif',</div>
<div> control: new OpenLayers.Control.ZoomBox({title:"Zoom out. Click on map or click and drag to zoom out.", out: true}),</div>
<div> map: map</div>
<div> });</div>
<div> </div>
<div> //Define toolbar, insert Ext Actions </div>
<div> var toolbar = new Ext.Toolbar([action_home, action_query, action_zoomin, action_zoomout]);</div>
<div> </div>
<div> </div>
<div> var panel_Bottom = new Ext.Panel({</div>
<div> collapsed: false,</div>
<div> items: [toolbar]</div>
<div> });</div>
<div> </div>
<div> </div>
<div> </div>
<div> var viewPort1 = new Ext.Viewport({</div>
<div> layout: "border",</div>
<div> items: [{</div>
<div> //Center Region - Map Panel Only</div>
<div> region: "center",</div>
<div> items: [panel_Map, panel_Bottom]</div>
<div> },{</div>
<div> // West Region - Themes Menu, Legend Menu, Overview Menu</div>
<div> region: "west",</div>
<div> xtype: 'panel',</div>
<div> title: "<center>Themes</center>",</div>
<div> width: 225,</div>
<div> split: true,</div>
<div> collapsible: true,</div>
<div> collapseMode: 'mini',</div>
<div> items: [panel_Themes, panel_Legend, panel_Overview] </div>
<div> }]</div>
<div>});</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
</font>
<DIV><P><HR>
This e-mail is intended for the original recipient(s) only. If you have received it in error, please advise the sender and delete this message.
</P></DIV>
</body>
</html>