replaced calls to addX and addY with calls to add. Simplify
git-svn-id: http://svn.openlayers.org/trunk/openlayers@51 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -19,7 +19,7 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
|||||||
div.ondblclick = this.doubleClick.bindAsEventListener(div);
|
div.ondblclick = this.doubleClick.bindAsEventListener(div);
|
||||||
div.onmousedown = this.singleClick.bindAsEventListener(div);
|
div.onmousedown = this.singleClick.bindAsEventListener(div);
|
||||||
this.div.appendChild(div);
|
this.div.appendChild(div);
|
||||||
pixel = pixel.addY(35);
|
pixel = pixel.add(0, 35);
|
||||||
}
|
}
|
||||||
return this.div;
|
return this.div;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -28,10 +28,10 @@ OpenLayers.Control.PanZoom.prototype =
|
|||||||
this._addButton("panup", "north-mini.png", centered, sz);
|
this._addButton("panup", "north-mini.png", centered, sz);
|
||||||
xy.y = centered.y+sz.h;
|
xy.y = centered.y+sz.h;
|
||||||
this._addButton("panleft", "west-mini.png", xy, sz);
|
this._addButton("panleft", "west-mini.png", xy, sz);
|
||||||
this._addButton("panright", "east-mini.png", xy.addX(sz.w), sz);
|
this._addButton("panright", "east-mini.png", xy.add(sz.w, 0), sz);
|
||||||
this._addButton("pandown", "south-mini.png", centered.addY(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.addY(sz.h*3), sz);
|
this._addButton("zoomin", "zoom-plus-mini.png", centered.add(0, sz.h*3), sz);
|
||||||
centered = centered.addY(sz.h*4);
|
centered = centered.add(0, sz.h*4);
|
||||||
this._addButton("zoomout", "zoom-minus-mini.png", centered, sz);
|
this._addButton("zoomout", "zoom-minus-mini.png", centered, sz);
|
||||||
return this.div;
|
return this.div;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -28,10 +28,10 @@ OpenLayers.Control.PanZoom.prototype =
|
|||||||
this._addButton("panup", "north-mini.png", centered, sz);
|
this._addButton("panup", "north-mini.png", centered, sz);
|
||||||
xy.y = centered.y+sz.h;
|
xy.y = centered.y+sz.h;
|
||||||
this._addButton("panleft", "west-mini.png", xy, sz);
|
this._addButton("panleft", "west-mini.png", xy, sz);
|
||||||
this._addButton("panright", "east-mini.png", xy.addX(sz.w), sz);
|
this._addButton("panright", "east-mini.png", xy.add(sz.w, 0), sz);
|
||||||
this._addButton("pandown", "south-mini.png", centered.addY(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.addY(sz.h*3), sz);
|
this._addButton("zoomin", "zoom-plus-mini.png", centered.add(0, sz.h*3), sz);
|
||||||
centered = centered.addY(sz.h*4);
|
centered = centered.add(0, sz.h*4);
|
||||||
centered = this._addZoomBar(centered,sz.copyOf());
|
centered = this._addZoomBar(centered,sz.copyOf());
|
||||||
this._addButton("zoomout", "zoom-minus-mini.png", centered, sz);
|
this._addButton("zoomout", "zoom-minus-mini.png", centered, sz);
|
||||||
return this.div;
|
return this.div;
|
||||||
@@ -40,7 +40,7 @@ OpenLayers.Control.PanZoom.prototype =
|
|||||||
var zoomStopSize = 15;
|
var zoomStopSize = 15;
|
||||||
var slider = OpenLayers.Util.createImage("img/slider.png",
|
var slider = OpenLayers.Util.createImage("img/slider.png",
|
||||||
new OpenLayers.Pixel(22,9),
|
new OpenLayers.Pixel(22,9),
|
||||||
centered.addY((this.map.getZoomLevels())*zoomStopSize), "absolute",
|
centered.add(0, (this.map.getZoomLevels())*zoomStopSize), "absolute",
|
||||||
"OpenLayers_Control_PanZoom_Slider");
|
"OpenLayers_Control_PanZoom_Slider");
|
||||||
sz.h = zoomStopSize*(this.map.getZoomLevels()+1);
|
sz.h = zoomStopSize*(this.map.getZoomLevels()+1);
|
||||||
sz.w = 17;
|
sz.w = 17;
|
||||||
@@ -62,7 +62,7 @@ OpenLayers.Control.PanZoom.prototype =
|
|||||||
slider.zIndex = this.div.zIndex + 5;
|
slider.zIndex = this.div.zIndex + 5;
|
||||||
this.div.appendChild(slider);
|
this.div.appendChild(slider);
|
||||||
this.buttons.append(slider);
|
this.buttons.append(slider);
|
||||||
centered = centered.addY(zoomStopSize*(this.map.getZoomLevels()+1));
|
centered = centered.add(0, zoomStopSize*(this.map.getZoomLevels()+1));
|
||||||
return centered;
|
return centered;
|
||||||
},
|
},
|
||||||
getMousePosition: function (evt) {
|
getMousePosition: function (evt) {
|
||||||
|
|||||||
@@ -79,29 +79,6 @@ OpenLayers.Pixel.prototype = {
|
|||||||
return ((d.w==0) && (d.h==0));
|
return ((d.w==0) && (d.h==0));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
/** Return a new Pixel with this pixel's x&y augmented by
|
|
||||||
* the Size value passed in.
|
|
||||||
*
|
|
||||||
* @param {int} w
|
|
||||||
*
|
|
||||||
* @return {OpenLayers.Pixel}
|
|
||||||
*/
|
|
||||||
addX:function(w) {
|
|
||||||
return new OpenLayers.Pixel(this.x+w, this.y);
|
|
||||||
},
|
|
||||||
|
|
||||||
/** Return a new Pixel with this pixel's y augmented by
|
|
||||||
* the int value passed in.
|
|
||||||
*
|
|
||||||
* @param {int} h
|
|
||||||
*
|
|
||||||
* @return {OpenLayers.Pixel}
|
|
||||||
*/
|
|
||||||
addY:function(h) {
|
|
||||||
return new OpenLayers.Pixel(this.x, this.y+h);
|
|
||||||
},
|
|
||||||
|
|
||||||
/** Return a new Pixel with this pixel's x&y augmented by
|
/** Return a new Pixel with this pixel's x&y augmented by
|
||||||
* the int values passed in.
|
* the int values passed in.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user