[OpenLayers-Trac] [OpenLayers] #882: JS error after using mousewheel without having moved the mouse before

OpenLayers trac at openlayers.org
Fri Aug 3 11:51:49 EDT 2007


#882: JS error after using mousewheel without having moved the mouse before
--------------------------------+-------------------------------------------
 Reporter:  openlayers          |       Owner:             
     Type:  bug                 |      Status:  new        
 Priority:  major               |   Milestone:  2.5 Release
Component:  Handler.MouseWheel  |     Version:  2.4        
 Keywords:                      |  
--------------------------------+-------------------------------------------
 __How to reproduce the bug :__[[BR]]
 Load any documents using OL with '''Firefox''' :[[BR]]
 1) Put the cursor into the map[[BR]]
 2) Refresh the document without moving the cursor[[BR]]
 3) Move the mousewheel up or down. You'll get a JS error in Firebug(evt.xy
 has no properties) until you move the mouse

 I may have identified the problem :

 {{{
             if (delta) {
                 // add the mouse position to the event because mozilla has
 a bug
                 // with clientX and clientY (see
 https://bugzilla.mozilla.org/show_bug.cgi?id=352179)
                 // getLonLatFromViewPortPx(e) returns wrong values
                 e.xy = this.mousePosition;
                 if (delta < 0) {
                    this.callback("down", [e, delta]);
                 } else {
                    this.callback("up", [e, delta]);
                 }
             }
 }}}

 this.mousePosition is only set after a mouse move. That is why evt.xy has
 no properties.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/882>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list