[Commits] r2657 - in core/trunk/geoext: lib/GeoExt/widgets tests/lib/GeoExt/widgets
commits at geoext.org
commits at geoext.org
Tue May 3 19:02:18 CEST 2011
Author: ahocevar
Date: 2011-05-03 19:02:18 +0200 (Tue, 03 May 2011)
New Revision: 2657
Modified:
core/trunk/geoext/lib/GeoExt/widgets/MapPanel.js
core/trunk/geoext/tests/lib/GeoExt/widgets/MapPanel.html
Log:
removing the forceInitialExtent config option that was introduced with r2654. r=tschaub (closes #421)
Modified: core/trunk/geoext/lib/GeoExt/widgets/MapPanel.js
===================================================================
--- core/trunk/geoext/lib/GeoExt/widgets/MapPanel.js 2011-04-29 14:50:32 UTC (rev 2656)
+++ core/trunk/geoext/lib/GeoExt/widgets/MapPanel.js 2011-05-03 17:02:18 UTC (rev 2657)
@@ -46,7 +46,11 @@
/** api: constructor
* .. class:: MapPanel(config)
*
- * Create a panel container for a map.
+ * Create a panel container for a map. The map contained by this panel
+ * will initially be zoomed to either the center and zoom level configured
+ * by the ``center`` and ``zoom`` configuration options, or the configured
+ * ``extent``, or - if neither are provided - the extent returned by the
+ * map's ``getExtent()`` method.
*/
GeoExt.MapPanel = Ext.extend(Ext.Panel, {
@@ -74,8 +78,9 @@
layers: null,
/** api: config[center]
- * ``OpenLayers.LonLat or Array(Number)`` A location for the map center. If
- * an array is provided, the first two items should represent x & y coordinates.
+ * ``OpenLayers.LonLat or Array(Number)`` A location for the initial map
+ * center. If an array is provided, the first two items should represent
+ * x & y coordinates.
*/
center: null,
@@ -91,14 +96,6 @@
*/
extent: null,
- /** api: config[forceInitialExtent]
- * ``Boolean`` If set to true, the map's initial extent (provided through
- * ``extent``, ``center`` or ``zoom``, or the map's maxExtent) will be set
- * even if the map or mapPanel has no layers configured when it is first
- * rendered. Default is false.
- */
- forceInitialExtent: false,
-
/** api: config[prettyStateKeys]
* ``Boolean`` Set this to true if you want pretty strings in the MapPanel's
* state keys. More specifically, layer.name instead of layer.id will be used
@@ -333,7 +330,7 @@
if (map.layers.length > 0) {
this.setInitialExtent();
- } else if (this.forceInitialExtent == true) {
+ } else {
this.layers.on("add", this.setInitialExtent, this, {single: true});
}
},
Modified: core/trunk/geoext/tests/lib/GeoExt/widgets/MapPanel.html
===================================================================
--- core/trunk/geoext/tests/lib/GeoExt/widgets/MapPanel.html 2011-04-29 14:50:32 UTC (rev 2656)
+++ core/trunk/geoext/tests/lib/GeoExt/widgets/MapPanel.html 2011-05-03 17:02:18 UTC (rev 2657)
@@ -181,13 +181,13 @@
panel = new GeoExt.MapPanel({
renderTo: "mappanel",
- forceInitialExtent: true,
height: 400,
width: 600,
extent: new OpenLayers.Bounds(1, 2, 3, 4)
});
panel.map.addLayer(new OpenLayers.Layer());
t.ok(panel.map.getExtent(), "map has an extent after layer is added");
+ panel.destroy();
}
function test_center(t) {
More information about the Commits
mailing list