From f218ad45089995cb6e71d6d89c528391d985c97e Mon Sep 17 00:00:00 2001 From: Schuyler Erle Date: Fri, 23 Mar 2007 14:23:58 +0000 Subject: [PATCH] Oops, didn't mean to check in changes to Navigation.js in r2867. Undo. git-svn-id: http://svn.openlayers.org/trunk/openlayers@2868 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Control/Navigation.js | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/lib/OpenLayers/Control/Navigation.js b/lib/OpenLayers/Control/Navigation.js index 4301b46369..4d449f234f 100644 --- a/lib/OpenLayers/Control/Navigation.js +++ b/lib/OpenLayers/Control/Navigation.js @@ -59,35 +59,20 @@ OpenLayers.Control.Navigation.prototype = return false; }, - wheelChange: function(evt, deltaZ) { - console.log("wheel " + deltaZ); - var newZoom = this.map.getZoom() + deltaZ; - if (!this.map.isValidZoomLevel(newZoom)) return; - - var size = this.map.getSize(); - var deltaX = size.w/2 - evt.xy.x; - var deltaY = size.h/2 - evt.xy.y; - var newRes = map.baseLayer.resolutions[newZoom]; - var zoomPoint = this.map.getLonLatFromPixel(evt.xy); - var newCenter = new OpenLayers.LonLat( - zoomPoint.lon + deltaX * newRes, - zoomPoint.lat - deltaY * newRes ); - console.log(newCenter.toString()); - this.map.setCenter( newCenter, newZoom ); - }, - /** User spun scroll wheel up * */ wheelUp: function(evt) { - this.wheelChange(evt, 1); + this.map.setCenter(this.map.getLonLatFromPixel(evt.xy), + this.map.getZoom() + 1); }, /** User spun scroll wheel down * */ wheelDown: function(evt) { - this.wheelChange(evt, -1); + this.map.setCenter(this.map.getLonLatFromPixel(evt.xy), + this.map.getZoom() - 1); }, /** @final @type String */