diff --git a/lib/OpenLayers/Control/PanZoomBar.js b/lib/OpenLayers/Control/PanZoomBar.js index 267f41a031..05e3bb8378 100644 --- a/lib/OpenLayers/Control/PanZoomBar.js +++ b/lib/OpenLayers/Control/PanZoomBar.js @@ -44,17 +44,21 @@ OpenLayers.Control.PanZoomBar.prototype = this._addButton("pandown", "south-mini.png", centered.add(0, sz.h*2), sz); this._addButton("zoomin", "zoom-plus-mini.png", centered.add(0, sz.h*3), sz); centered = centered.add(0, sz.h*4); - centered = this._addZoomBar(centered,sz.copyOf()); + centered = this._addZoomBar(centered); this._addButton("zoomout", "zoom-minus-mini.png", centered, sz); return this.div; }, - _addZoomBar:function(centered,sz) { + + /** + * @param {OpenLayers.Pixel} location where zoombar drawing is to start. + */ + _addZoomBar:function(centered) { var imgLocation = OpenLayers.Util.getImagesLocation(); - var zoomStopSize = this.zoomStopHeight; var id = "OpenLayers_Control_PanZoomBar_Slider" + this.map.id; var slider = OpenLayers.Util.createAlphaImageDiv(id, - centered.add(-1, (this.map.getZoomLevels())*zoomStopSize), + centered.add(-1, + (this.map.getZoomLevels())*this.zoomStopHeight), new OpenLayers.Size(20,9), imgLocation+"slider.png", "absolute"); @@ -67,14 +71,16 @@ OpenLayers.Control.PanZoomBar.prototype = this.sliderEvents.register("mouseup", this, this.zoomBarUp); this.sliderEvents.register("dblclick", this, this.doubleClick); - sz.h = zoomStopSize*(this.map.getZoomLevels()+1); + sz = new OpenLayers.Size(); + sz.h = this.zoomStopHeight*(this.map.getZoomLevels()+1); sz.w = this.zoomStopWidth; var div = null if (OpenLayers.Util.alphaHack()) { var id = "OpenLayers_Control_PanZoomBar" + this.map.id; div = OpenLayers.Util.createAlphaImageDiv(id, centered, - new OpenLayers.Size(sz.w, zoomStopSize), + new OpenLayers.Size(sz.w, + this.zoomStopHeight), imgLocation + "zoombar.png", "absolute", null, "crop"); div.style.height = sz.h;