[OpenLayers-Commits] r11520 -
sandbox/ahocevar/layercontainer/lib/OpenLayers
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Fri Feb 25 11:01:51 EST 2011
Author: ahocevar
Date: 2011-02-25 08:01:50 -0800 (Fri, 25 Feb 2011)
New Revision: 11520
Modified:
sandbox/ahocevar/layercontainer/lib/OpenLayers/Map.js
Log:
calculating the center requires the map's size to be set
Modified: sandbox/ahocevar/layercontainer/lib/OpenLayers/Map.js
===================================================================
--- sandbox/ahocevar/layercontainer/lib/OpenLayers/Map.js 2011-02-25 16:01:09 UTC (rev 11519)
+++ sandbox/ahocevar/layercontainer/lib/OpenLayers/Map.js 2011-02-25 16:01:50 UTC (rev 11520)
@@ -1524,7 +1524,7 @@
* {<OpenLayers.LonLat>}
*/
getCachedCenter: function() {
- if (!this.center) {
+ if (!this.center && this.size) {
this.center = this.getLonLatFromViewPortPx(
new OpenLayers.Pixel(this.size.w / 2, this.size.h / 2)
);
More information about the Commits
mailing list