Commit tests and code for #610, reviewed by Schuyler, to resolve
PanZoom/PanZoomBar position argument. git-svn-id: http://svn.openlayers.org/trunk/openlayers@2965 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -27,9 +27,9 @@ OpenLayers.Control.PanZoom.prototype =
|
||||
* @constructor
|
||||
*/
|
||||
initialize: function() {
|
||||
OpenLayers.Control.prototype.initialize.apply(this, arguments);
|
||||
this.position = new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X,
|
||||
OpenLayers.Control.PanZoom.Y);
|
||||
OpenLayers.Control.prototype.initialize.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
* @requires OpenLayers/Control/PanZoom.js
|
||||
*/
|
||||
OpenLayers.Control.PanZoomBar = OpenLayers.Class.create();
|
||||
OpenLayers.Control.PanZoomBar.X = 4;
|
||||
OpenLayers.Control.PanZoomBar.Y = 4;
|
||||
OpenLayers.Control.PanZoomBar.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Control.PanZoom, {
|
||||
|
||||
@@ -34,8 +32,6 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
|
||||
initialize: function() {
|
||||
OpenLayers.Control.PanZoom.prototype.initialize.apply(this, arguments);
|
||||
this.position = new OpenLayers.Pixel(OpenLayers.Control.PanZoomBar.X,
|
||||
OpenLayers.Control.PanZoomBar.Y);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,10 +4,13 @@
|
||||
<script type="text/javascript"><!--
|
||||
var map;
|
||||
function test_01_Control_PanZoom_constructor (t) {
|
||||
t.plan( 1 );
|
||||
t.plan( 3 );
|
||||
|
||||
control = new OpenLayers.Control.PanZoom();
|
||||
t.ok( control instanceof OpenLayers.Control.PanZoom, "new OpenLayers.Control.PanZoom returns object" );
|
||||
control = new OpenLayers.Control.PanZoom({position: new OpenLayers.Pixel(100,100)});
|
||||
t.eq( control.position.x, 100, "PanZoom X Set correctly.");
|
||||
t.eq( control.position.y, 100, "PanZoom y Set correctly.");
|
||||
}
|
||||
function test_02_Control_PanZoom_addControl (t) {
|
||||
t.plan( 8 );
|
||||
|
||||
@@ -4,10 +4,12 @@
|
||||
<script type="text/javascript"><!--
|
||||
var map;
|
||||
function test_01_Control_PanZoomBar_constructor (t) {
|
||||
t.plan( 1 );
|
||||
t.plan( 3 );
|
||||
|
||||
control = new OpenLayers.Control.PanZoomBar();
|
||||
control = new OpenLayers.Control.PanZoomBar({position: new OpenLayers.Pixel(100,100)});
|
||||
t.ok( control instanceof OpenLayers.Control.PanZoomBar, "new OpenLayers.Control.PanZoomBar returns object" );
|
||||
t.eq( control.position.x, 100, "PanZoom X Set correctly.");
|
||||
t.eq( control.position.y, 100, "PanZoom y Set correctly.");
|
||||
}
|
||||
function test_02_Control_PanZoomBar_addControl (t) {
|
||||
t.plan( 8 );
|
||||
|
||||
Reference in New Issue
Block a user