Ticket #882 (closed bug: fixed)
JS error after using mousewheel without having moved the mouse before
| Reported by: | openlayers | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 2.5 Release |
| Component: | Handler.MouseWheel | Version: | 2.4 |
| Keywords: | Cc: | nicolas.malaval@… | |
| State: |
Description
How to reproduce the bug :
Load any documents using OL with Firefox :
1) Put the cursor into the map
2) Refresh the document without moving the cursor
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.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

