From 11924d0d0fb6f9504107ffe33c991a72e45d94ba Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Wed, 9 Dec 2009 15:34:19 +0000 Subject: [PATCH] Only zoom by integer values with changes in the mouse wheel. r=bartvde (closes #2376) git-svn-id: http://svn.openlayers.org/trunk/openlayers@9876 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Control/Navigation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OpenLayers/Control/Navigation.js b/lib/OpenLayers/Control/Navigation.js index a54ac46823..10e1387121 100644 --- a/lib/OpenLayers/Control/Navigation.js +++ b/lib/OpenLayers/Control/Navigation.js @@ -211,7 +211,7 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, { */ wheelChange: function(evt, deltaZ) { var currentZoom = this.map.getZoom(); - var newZoom = this.map.getZoom() + deltaZ; + var newZoom = this.map.getZoom() + Math.round(deltaZ); newZoom = Math.max(newZoom, 0); newZoom = Math.min(newZoom, this.map.getNumZoomLevels()); if (newZoom === currentZoom) {