diff --git a/lib/OpenLayers/Layer/Google.js b/lib/OpenLayers/Layer/Google.js index 19f3acfbc6..2439395f4a 100644 --- a/lib/OpenLayers/Layer/Google.js +++ b/lib/OpenLayers/Layer/Google.js @@ -356,20 +356,30 @@ OpenLayers.Layer.Google.prototype = Object.extend( new OpenLayers.Layer(), { * @param {int} gZoom * * @returns An OpenLayers Zoom level, translated from the passed in gZoom + * Returns null if null value is passed in * @type int */ getOLZoomFromGZoom: function(gZoom) { - return (gZoom - 1); + var zoom = null; + if (gZoom != null) { + zoom = gZoom - 1; + } + return zoom; }, /** * @param {int} olZoom * * @returns A GZoom level, translated from the passed in olZoom + * Returns null if null value is passed in * @type int */ getGZoomFromOLZoom: function(olZoom) { - return (olZoom + 1); + var zoom = null; + if (olZoom != null) { + zoom = olZoom + 1; + } + return zoom; }, //