Changeset 1945
- Timestamp:
- 11/21/06 03:32:13 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Control/MouseDefaults.js
r1721 r1945 95 95 */ 96 96 defaultMouseMove: function (evt) { 97 // record the mouse position, used in onWheelEvent 98 this.mousePosition = evt.xy.clone(); 99 97 100 if (this.mouseDragStart != null) { 98 101 if (this.zoomBox) { … … 156 159 * 157 160 */ 158 defaultWheelUp: function() { 159 this.map.zoomIn(); 161 defaultWheelUp: function(evt) { 162 if (this.map.getZoom() <= this.map.getNumZoomLevels()) { 163 this.map.setCenter(this.map.getLonLatFromPixel(evt.xy), 164 this.map.getZoom() + 1); 165 } 160 166 }, 161 167 … … 163 169 * 164 170 */ 165 defaultWheelDown: function() { 166 this.map.zoomOut(); 171 defaultWheelDown: function(evt) { 172 if (this.map.getZoom() > 0) { 173 this.map.setCenter(this.map.getLonLatFromPixel(evt.xy), 174 this.map.getZoom() - 1); 175 } 167 176 }, 168 177 … … 239 248 } 240 249 if (delta) { 250 // add the mouse position to the event because mozilla has a bug 251 // with clientX and clientY (see https://bugzilla.mozilla.org/show_bug.cgi?id=352179) 252 // getLonLatFromViewPortPx(e) returns wrong values 253 e.xy = this.mousePosition; 254 241 255 if (delta < 0) { 242 this.defaultWheelDown( );256 this.defaultWheelDown(e); 243 257 } else { 244 this.defaultWheelUp( );258 this.defaultWheelUp(e); 245 259 } 246 260 }
