diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js
index <HASH>..<HASH> 100644
--- a/lib/OpenLayers/Map.js
+++ b/lib/OpenLayers/Map.js
@@ -1008,7 +1008,10 @@ OpenLayers.Map.prototype = {
             var dY = -parseInt(this.layerContainerDiv.style.top);
             layerPx = viewPortPx.add(dX, dY);
         }
-        return layerPx;
+        if (!isNaN(layerPx.x) && !isNaN(layerPx.y)) {
+            return layerPx;
+        }
+        return null;
     },
     
   //
Don't ever return NaN from getLayerContainerPxFromViewPortPx, since that
can cause problems in multiple different layers -- instead, just return 
null, which is handled more gracefully.


git-svn-id: <URL>