r401@creusa: crschmidt | 2006-05-27 12:12:17 -0400
Don't create local variable zoomStopSize. Remove sz variable -- it was only being modified, so create it inside the function instead. git-svn-id: http://svn.openlayers.org/trunk/openlayers@425 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -44,17 +44,21 @@ OpenLayers.Control.PanZoomBar.prototype =
|
|||||||
this._addButton("pandown", "south-mini.png", centered.add(0, sz.h*2), sz);
|
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);
|
this._addButton("zoomin", "zoom-plus-mini.png", centered.add(0, sz.h*3), sz);
|
||||||
centered = centered.add(0, sz.h*4);
|
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);
|
this._addButton("zoomout", "zoom-minus-mini.png", centered, sz);
|
||||||
return this.div;
|
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 imgLocation = OpenLayers.Util.getImagesLocation();
|
||||||
|
|
||||||
var zoomStopSize = this.zoomStopHeight;
|
|
||||||
var id = "OpenLayers_Control_PanZoomBar_Slider" + this.map.id;
|
var id = "OpenLayers_Control_PanZoomBar_Slider" + this.map.id;
|
||||||
var slider = OpenLayers.Util.createAlphaImageDiv(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),
|
new OpenLayers.Size(20,9),
|
||||||
imgLocation+"slider.png",
|
imgLocation+"slider.png",
|
||||||
"absolute");
|
"absolute");
|
||||||
@@ -67,14 +71,16 @@ OpenLayers.Control.PanZoomBar.prototype =
|
|||||||
this.sliderEvents.register("mouseup", this, this.zoomBarUp);
|
this.sliderEvents.register("mouseup", this, this.zoomBarUp);
|
||||||
this.sliderEvents.register("dblclick", this, this.doubleClick);
|
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;
|
sz.w = this.zoomStopWidth;
|
||||||
var div = null
|
var div = null
|
||||||
|
|
||||||
if (OpenLayers.Util.alphaHack()) {
|
if (OpenLayers.Util.alphaHack()) {
|
||||||
var id = "OpenLayers_Control_PanZoomBar" + this.map.id;
|
var id = "OpenLayers_Control_PanZoomBar" + this.map.id;
|
||||||
div = OpenLayers.Util.createAlphaImageDiv(id, centered,
|
div = OpenLayers.Util.createAlphaImageDiv(id, centered,
|
||||||
new OpenLayers.Size(sz.w, zoomStopSize),
|
new OpenLayers.Size(sz.w,
|
||||||
|
this.zoomStopHeight),
|
||||||
imgLocation + "zoombar.png",
|
imgLocation + "zoombar.png",
|
||||||
"absolute", null, "crop");
|
"absolute", null, "crop");
|
||||||
div.style.height = sz.h;
|
div.style.height = sz.h;
|
||||||
|
|||||||
Reference in New Issue
Block a user