OpenLayers OpenLayers

Ticket #610: panzoom.2.patch

File panzoom.2.patch, 3.1 kB (added by crschmidt, 2 years ago)
  • tests/Control/test_PanZoom.html

    old new  
    44  <script type="text/javascript"><!-- 
    55    var map;  
    66    function test_01_Control_PanZoom_constructor (t) { 
    7         t.plan( 1 ); 
     7        t.plan( 3 ); 
    88     
    99        control = new OpenLayers.Control.PanZoom(); 
    1010        t.ok( control instanceof OpenLayers.Control.PanZoom, "new OpenLayers.Control.PanZoom returns object" ); 
     11        control = new OpenLayers.Control.PanZoom({position: new OpenLayers.Pixel(100,100)}); 
     12        t.eq( control.position.x, 100, "PanZoom X Set correctly.");  
     13        t.eq( control.position.y, 100, "PanZoom y Set correctly.");  
    1114    } 
    1215    function test_02_Control_PanZoom_addControl (t) { 
    1316        t.plan( 8 ); 
  • tests/Control/test_PanZoomBar.html

    old new  
    44  <script type="text/javascript"><!-- 
    55    var map;  
    66    function test_01_Control_PanZoomBar_constructor (t) { 
    7         t.plan( 1 ); 
     7        t.plan( 3 ); 
    88     
    9         control = new OpenLayers.Control.PanZoomBar(); 
     9        control = new OpenLayers.Control.PanZoomBar({position: new OpenLayers.Pixel(100,100)}); 
    1010        t.ok( control instanceof OpenLayers.Control.PanZoomBar, "new OpenLayers.Control.PanZoomBar returns object" ); 
     11        t.eq( control.position.x, 100, "PanZoom X Set correctly.");  
     12        t.eq( control.position.y, 100, "PanZoom y Set correctly.");  
    1113    } 
    1214    function test_02_Control_PanZoomBar_addControl (t) { 
    1315        t.plan( 8 ); 
  • lib/OpenLayers/Control/PanZoomBar.js

    old new  
    99 * @requires OpenLayers/Control/PanZoom.js 
    1010 */ 
    1111OpenLayers.Control.PanZoomBar = OpenLayers.Class.create(); 
    12 OpenLayers.Control.PanZoomBar.X = 4; 
    13 OpenLayers.Control.PanZoomBar.Y = 4; 
    1412OpenLayers.Control.PanZoomBar.prototype =  
    1513  OpenLayers.Class.inherit( OpenLayers.Control.PanZoom, { 
    1614 
     
    3432 
    3533    initialize: function() { 
    3634        OpenLayers.Control.PanZoom.prototype.initialize.apply(this, arguments); 
    37         this.position = new OpenLayers.Pixel(OpenLayers.Control.PanZoomBar.X, 
    38                                              OpenLayers.Control.PanZoomBar.Y); 
    3935    }, 
    4036 
    4137    /** 
  • lib/OpenLayers/Control/PanZoom.js

    old new  
    2727     * @constructor 
    2828     */ 
    2929    initialize: function() { 
    30         OpenLayers.Control.prototype.initialize.apply(this, arguments); 
    3130        this.position = new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X, 
    3231                                             OpenLayers.Control.PanZoom.Y); 
     32        OpenLayers.Control.prototype.initialize.apply(this, arguments); 
    3333    }, 
    3434 
    3535    /**