[OpenLayers-Commits] r3139 - sandbox/tschaub/google/lib/OpenLayers/Layer

commits at openlayers.org commits at openlayers.org
Mon May 7 12:49:42 EDT 2007


Author: tschaub
Date: 2007-05-07 12:49:42 -0400 (Mon, 07 May 2007)
New Revision: 3139

Modified:
   sandbox/tschaub/google/lib/OpenLayers/Layer/GoogleMercator.js
Log:
get rid of this dateline wrapping nonsense - maps are flat for Pete's sake - getExtent now uses calculateBounds - if you let the center stray beyond the maxExtent, you're on your own (and are at risk of sailing off the edge of the world)

Modified: sandbox/tschaub/google/lib/OpenLayers/Layer/GoogleMercator.js
===================================================================
--- sandbox/tschaub/google/lib/OpenLayers/Layer/GoogleMercator.js	2007-05-07 10:52:08 UTC (rev 3138)
+++ sandbox/tschaub/google/lib/OpenLayers/Layer/GoogleMercator.js	2007-05-07 16:49:42 UTC (rev 3139)
@@ -37,6 +37,18 @@
         OpenLayers.Layer.Google.prototype.initialize.apply(this, arguments);
     },
 
+    /** 
+     * @returns A Bounds object which represents the lon/lat bounds of the 
+     *          current viewPort.
+     * @type OpenLayers.Bounds
+     */
+    getExtent: function() {
+        // just use stock map calculateBounds function -- passing no arguments
+        //  means it will user map's current center & resolution
+        //
+        return this.map.calculateBounds();
+    },
+
     /**
      * @param {Object} moBounds
      * 



More information about the Commits mailing list