[OpenLayers-Commits] r11445 - sandbox/ahocevar/layercontainer/lib/OpenLayers

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Thu Feb 24 18:06:35 EST 2011


Author: ahocevar
Date: 2011-02-24 15:06:34 -0800 (Thu, 24 Feb 2011)
New Revision: 11445

Modified:
   sandbox/ahocevar/layercontainer/lib/OpenLayers/Layer.js
Log:
additional check so the method does not fail - equivalent to the check for center in the old method

Modified: sandbox/ahocevar/layercontainer/lib/OpenLayers/Layer.js
===================================================================
--- sandbox/ahocevar/layercontainer/lib/OpenLayers/Layer.js	2011-02-24 23:04:49 UTC (rev 11444)
+++ sandbox/ahocevar/layercontainer/lib/OpenLayers/Layer.js	2011-02-24 23:06:34 UTC (rev 11445)
@@ -1210,8 +1210,8 @@
      */
     getLonLatFromViewPortPx: function (viewPortPx) {
         var lonlat = null;
-        if (viewPortPx != null) {
-            var map = this.map;
+        var map = this.map;
+        if (viewPortPx != null && map.minPx) {
             var res = map.getResolution();
             var maxExtent = map.getMaxExtent();
             var lon = (viewPortPx.x - map.minPx.x) * res + maxExtent.left;



More information about the Commits mailing list