[Commits] r364 - in apps/opengeo/geoexplorer/trunk: lib theme

commits at geoext.org commits at geoext.org
Wed Apr 8 01:31:28 CEST 2009


Author: tschaub
Date: 2009-04-08 01:31:28 +0200 (Wed, 08 Apr 2009)
New Revision: 364

Modified:
   apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js
   apps/opengeo/geoexplorer/trunk/theme/geoexplorer.css
Log:
Adding navigation control explicitly and giving it a button (see #122).

Modified: apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js
===================================================================
--- apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js	2009-04-07 23:13:26 UTC (rev 363)
+++ apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js	2009-04-07 23:31:28 UTC (rev 364)
@@ -156,7 +156,10 @@
      */
     initMap: function() {
         // TODO: check this.initialConfig.map for any map options
-        this.map = new OpenLayers.Map({allOverlays: true});
+        this.map = new OpenLayers.Map({
+            allOverlays: true,
+            controls: []
+        });
 
         //TODO: make this more configurable
         this.map.events.on({
@@ -248,6 +251,12 @@
     },
 
     initMapControlsAndToolbar: function() {
+
+        
+        // create a navigation control
+        var navControl = new OpenLayers.Control.Navigation();
+        this.map.addControl(navControl);        
+        
         var mapControls = { 
             getFeatureInfo: new OpenLayers.Control.WMSGetFeatureInfo(this.initialConfig.ows, {
                 queryVisible: true
@@ -274,6 +283,20 @@
             "|"
             ,
             new Ext.Button({
+                tooltip: "Pan Map",
+                iconCls: "icon-pan",
+                enableToggle: true,
+                toggleGroup: toolGroup,
+                toggleHandler: function(b, pressed) {
+                    if(pressed) {
+                        navControl.activate();
+                    } else {
+                        navControl.deactivate();
+                    }
+                },
+                scope: this
+            }),
+            new Ext.Button({
                 tooltip: "Get Feature Info",
                 iconCls: "icon-getfeatureinfo",
                 toggleGroup: toolGroup,

Modified: apps/opengeo/geoexplorer/trunk/theme/geoexplorer.css
===================================================================
--- apps/opengeo/geoexplorer/trunk/theme/geoexplorer.css	2009-04-07 23:13:26 UTC (rev 363)
+++ apps/opengeo/geoexplorer/trunk/theme/geoexplorer.css	2009-04-07 23:31:28 UTC (rev 364)
@@ -24,4 +24,8 @@
 
 .icon-zoom-visible { 
     background-image: url(img/silk/arrow_out.png) !important;
+}
+
+.icon-pan { 
+    background-image: url(img/geosilk/pan.png) !important;
 }
\ No newline at end of file



More information about the Commits mailing list