Ticket #2384 (closed bug: fixed)
PanZoomBar slider bug winxp IE6+, firefox 3+
| Reported by: | sowee | Owned by: | crschmidt |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.9 Release |
| Component: | Control.PanZoomBar | Version: | 2.8 |
| Keywords: | Cc: | asoares1@… | |
| State: | Complete |
Description
Once the slider has been dragged at least one time, if you click on the zoom bar to set the zoom to a specific level, the slider is sometimes misplaced.
What happens is that once a drag is made, the variable zoomStart is set and it looks like it's never set to null. When the user then clicks on the zoombar, the divClick handler is executed onMouseDown and since this method moves the slider to the zoom level clicked - under the mouse cursor -, when the user releases the mouse button the mouseup event of the slider occurs and zoomBarUp is called. However, the zoomBarUp handler executes its code if zoomStart is not null, which is always the case once a drag has been made. The code then moves the slider again depending on the cursor relative position.
My fix is to simple put "this.zoomStart = null;" just before "OpenLayers.Event.stop(evt);" in the handler "zoomBarUp". In my case, it fixes the problem.
I've noticed the same behavior on a couple of sites using OpenLayers, in particular http://www.openstreetmap.org/.
