[Commits] r363 - in apps/opengeo/geoexplorer/trunk: lib theme
commits at geoext.org
commits at geoext.org
Wed Apr 8 01:13:27 CEST 2009
Author: tschaub
Date: 2009-04-08 01:13:26 +0200 (Wed, 08 Apr 2009)
New Revision: 363
Modified:
apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js
apps/opengeo/geoexplorer/trunk/theme/geoexplorer.css
Log:
Adding a zoom to visible extent button. Note that this requirest that layers are configured with a maxExtent (not currently the case). (see #125)
Modified: apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js
===================================================================
--- apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js 2009-04-07 22:46:39 UTC (rev 362)
+++ apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js 2009-04-07 23:13:26 UTC (rev 363)
@@ -313,6 +313,27 @@
},
iconCls: "icon-zoom-out",
scope: this
+ }),
+ new Ext.Button({
+ tooltip: "Zoom to Visible Extent",
+ iconCls: "icon-zoom-visible",
+ handler: function() {
+ var extent, layer;
+ for(var i=0, len=this.map.layers.length; i<len; ++i) {
+ layer = this.map.layers[i];
+ if(layer.getVisibility()) {
+ if(extent) {
+ extent.extend(layer.maxExtent);
+ } else {
+ extent = layer.maxExtent.clone();
+ }
+ }
+ }
+ if(extent) {
+ this.map.zoomToExtent(extent);
+ }
+ },
+ scope: this
})
];
Modified: apps/opengeo/geoexplorer/trunk/theme/geoexplorer.css
===================================================================
--- apps/opengeo/geoexplorer/trunk/theme/geoexplorer.css 2009-04-07 22:46:39 UTC (rev 362)
+++ apps/opengeo/geoexplorer/trunk/theme/geoexplorer.css 2009-04-07 23:13:26 UTC (rev 363)
@@ -20,4 +20,8 @@
.icon-zoom-out {
background-image: url(img/silk/magnifier_zoom_out.png) !important;
+}
+
+.icon-zoom-visible {
+ background-image: url(img/silk/arrow_out.png) !important;
}
\ No newline at end of file
More information about the Commits
mailing list