Fix click-to-zoom.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@373 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-05-25 18:39:15 +00:00
parent 621d7074f2
commit c8ed8cee87

View File

@@ -91,7 +91,7 @@ OpenLayers.Control.PanZoomBar.prototype =
}, },
divClick: function (evt) { divClick: function (evt) {
var y = evt.xy.y; var y = evt.xy.y;
var top = parseInt(this.slider.top); var top = Position.page(evt.object)[1];
var levels = Math.floor((y - top)/this.zoomStopHeight); var levels = Math.floor((y - top)/this.zoomStopHeight);
this.map.zoomTo(this.map.getZoomLevels() - levels); this.map.zoomTo(this.map.getZoomLevels() - levels);
Event.stop(evt); Event.stop(evt);