2.6 accidentally broke behavior when clicking on the panzoombar. Thanks to Linda Rawson's report of this issue, this is now fixed, by moving the Math.floor call to a different part of the code. r=euzuro (Pullup #1486)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6799 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -242,12 +242,11 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
|
||||
var y = evt.xy.y;
|
||||
var top = OpenLayers.Util.pagePosition(evt.object)[1];
|
||||
var levels = (y - top)/this.zoomStopHeight;
|
||||
var zoom = (this.map.getNumZoomLevels() - 1) - levels;
|
||||
if(this.map.fractionalZoom) {
|
||||
zoom = Math.min(Math.max(zoom, 0), this.map.getNumZoomLevels() - 1);
|
||||
} else {
|
||||
zoom = Math.floor(zoom);
|
||||
if(!this.map.fractionalZoom) {
|
||||
levels = Math.floor(levels);
|
||||
}
|
||||
var zoom = (this.map.getNumZoomLevels() - 1) - levels;
|
||||
zoom = Math.min(Math.max(zoom, 0), this.map.getNumZoomLevels() - 1);
|
||||
this.map.zoomTo(zoom);
|
||||
OpenLayers.Event.stop(evt);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user