[OpenLayers-Users] mousewheel

Mike Quentel mquentel at rim.com
Wed Apr 23 10:23:40 EDT 2008


Try modifying the following mouse wheel related events.  I changed these
because I wanted the mouse wheel to zoom in using the centre of the map,
not centre at mouse cursor.

in Navigation.js:

    /** 
     * Method: wheelUp
     * User spun scroll wheel up
     * 
     * Parameters:
     * evt - {Event}
     */
    wheelUp: function(evt) {
        //this.wheelChange(evt, 1);
        this.map.zoomIn();
    },

    /** 
     * Method: wheelDown
     * User spun scroll wheel down
     * 
     * Parameters:
     * evt - {Event}
     */
    wheelDown: function(evt) {
        //this.wheelChange(evt, -1);
        this.map.zoomOut();
    },

in MouseDefaults.js:

    /** 
     * Method: defaultWheelUp
     * User spun scroll wheel up
     * 
     */
    defaultWheelUp: function(evt) {
//        if (this.map.getZoom() <= this.map.getNumZoomLevels()) {
//            this.map.setCenter(this.map.getLonLatFromPixel(evt.xy),
//                               this.map.getZoom() + 1);
//        }
         this.map.zoomIn();
    },

    /**
     * Method: defaultWheelDown
     * User spun scroll wheel down
     */
    defaultWheelDown: function(evt) {
//        if (this.map.getZoom() > 0) {
//            this.map.setCenter(this.map.getLonLatFromPixel(evt.xy),
//                               this.map.getZoom() - 1);
//        }
          this.map.zoomOut();
    },

-----Original Message-----
From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org]
On Behalf Of matthewsnape
Sent: Wednesday, 23 April 2008 09:22
To: users at openlayers.org
Subject: [OpenLayers-Users] mousewheel


Hi,

I have a problem with the mousewheel.  When I zoom in and out it zooms
by 2 steps instead of just one.  If I zoom in or out using the pan zoom
bar it only uses a single increment. Any ideas why this may be
happening?

Thanks.
--
View this message in context:
http://www.nabble.com/mousewheel-tp16834598p16834598.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.

_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users

---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.



More information about the Users mailing list