OpenLayers OpenLayers
Show
Ignore:
Timestamp:
05/22/06 13:25:46 (3 years ago)
Author:
sderle
Message:

Added a position property to Control, which allows us to specify a default
location for each Control class, and saves us from *having* to supply a pixel
position to the map.addControl() method -- the sensible default will tend to be
used instead.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/tests/test_Control_PanZoom.html

    r255 r269  
    1111    } 
    1212    function test_02_Control_PanZoom_addControl (t) { 
    13         t.plan( 6 ); 
     13        t.plan( 8 ); 
    1414        map = new OpenLayers.Map('map'); 
    1515        control = new OpenLayers.Control.PanZoom(); 
    1616        t.ok( control instanceof OpenLayers.Control.PanZoom, "new OpenLayers.Control.PanZoom returns object" ); 
    1717        t.ok( map instanceof OpenLayers.Map, "new OpenLayers.Map creates map" ); 
    18         map.addControl(control, 
    19                        new OpenLayers.Pixel(10,10)); 
     18        map.addControl(control); 
    2019        t.ok( control.map === map, "Control.map is set to the map object" ); 
    2120        t.ok( map.controls[2] === control, "map.controls contains control" ); 
    2221        t.eq( control.div.style.zIndex, "253", "Control div zIndexed properly" ); 
    2322        t.eq( map.viewPortDiv.lastChild.style.zIndex, "253", "Viewport div contains control div" ); 
     23        t.eq( control.div.style.top, "4px", "Control div top located correctly by default"); 
     24 
     25        var control2 = new OpenLayers.Control.PanZoom(); 
     26        map.addControl(control2, new OpenLayers.Pixel(100,100)); 
     27        t.eq( control2.div.style.top, "100px", "2nd control div is located correctly"); 
    2428    } 
    2529    function test_03_Control_PanZoom_control_events (t) {