"Sometimes, it is handy to have "zoomWorld" icon in

OpenLayers.Control.PanZoomBar. This patch enables it." Patch from jachym.
(Closes #1131)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@5159 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-11-09 17:57:27 +00:00
parent 10eaa329ba
commit c986fe376e
2 changed files with 18 additions and 2 deletions

View File

@@ -47,6 +47,12 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
*/
divEvents: null,
/**
* Property: zoomWorldIcon
* {Boolean}
*/
zoomWorldIcon: false,
/**
* Constructor: <OpenLayers.Control.PanZoomBar>
*/
@@ -115,11 +121,21 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
var sz = new OpenLayers.Size(18,18);
var centered = new OpenLayers.Pixel(px.x+sz.w/2, px.y);
var wposition = sz.w;
if (this.zoomWorldIcon) {
centered = new OpenLayers.Pixel(px.x+sz.w, px.y);
}
this._addButton("panup", "north-mini.png", centered, sz);
px.y = centered.y+sz.h;
this._addButton("panleft", "west-mini.png", px, sz);
this._addButton("panright", "east-mini.png", px.add(sz.w, 0), sz);
if (this.zoomWorldIcon) {
this._addButton("zoomworld", "zoom-world-mini.png", px.add(sz.w, 0), sz);
wposition *= 2;
}
this._addButton("panright", "east-mini.png", px.add(wposition, 0), 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+5), sz);
centered = this._addZoomBar(centered.add(0, sz.h*4 + 5));