[Commits] r405 - apps/opengeo/geoexplorer/trunk/lib
commits at geoext.org
commits at geoext.org
Fri Apr 17 01:10:56 CEST 2009
Author: tschaub
Date: 2009-04-17 01:10:56 +0200 (Fri, 17 Apr 2009)
New Revision: 405
Modified:
apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js
Log:
Add zoom to layer extent item in node context menu. This can be swapped out with an action if we need to use the same in a different component.
Modified: apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js
===================================================================
--- apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js 2009-04-16 22:54:50 UTC (rev 404)
+++ apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js 2009-04-16 23:10:56 UTC (rev 405)
@@ -202,7 +202,20 @@
scope: this
},
contextMenu: new Ext.menu.Menu({
- items: [removeLayerAction],
+ items: [
+ {
+ text: "Zoom to Layer Extent",
+ iconCls: "icon-zoom-visible",
+ handler: function() {
+ var node = layerTree.getSelectionModel().getSelectedNode();
+ if(node && node.layer) {
+ this.map.zoomToExtent(node.layer.maxExtent);
+ }
+ },
+ scope: this
+ },
+ removeLayerAction
+ ],
})
});
More information about the Commits
mailing list