~mortenoh/+junk/dhis2-detailed-import-export

« back to all changes in this revision

Viewing changes to gis/dhis-gis-geostat/mfbase/openlayers/tests/Control/Attribution.html

  • Committer: larshelge at gmail
  • Date: 2009-03-03 16:46:36 UTC
  • Revision ID: larshelge@gmail.com-20090303164636-2sjlrquo7ib1gf7r
Initial check-in

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<head>
 
3
  <script src="../../lib/OpenLayers.js"></script>
 
4
  <script type="text/javascript">
 
5
    var map; 
 
6
    function test_Control_Attribution_constructor (t) {
 
7
        t.plan( 2 );
 
8
    
 
9
        control = new OpenLayers.Control.Attribution();
 
10
        t.ok( control instanceof OpenLayers.Control.Attribution, "new OpenLayers.Control returns object" );
 
11
        t.eq( control.displayClass,  "olControlAttribution", "displayClass is correct" );
 
12
    }
 
13
    function test_Control_Attribution_setBaseLayer (t) {
 
14
        t.plan(1);
 
15
        map = new OpenLayers.Map("map");
 
16
        map.addControl(control);
 
17
        map.addLayer(new OpenLayers.Layer("name",{'attribution':'My layer!', isBaseLayer: true}));
 
18
        map.addLayer(new OpenLayers.Layer("name",{'attribution':'My layer 2!', isBaseLayer: true}));
 
19
        map.setBaseLayer(map.layers[1]);
 
20
        t.eq(control.div.innerHTML, 'My layer 2!', "Attribution correct with changed base layer");
 
21
 
 
22
    }
 
23
    function test_Control_Attribution_draw (t) {
 
24
        t.plan(3);
 
25
        control = new OpenLayers.Control.Attribution();
 
26
        map = new OpenLayers.Map("map");
 
27
        map.addControl(control);
 
28
        map.addLayer(new OpenLayers.Layer("name",{'attribution':'My layer!'}));
 
29
        t.eq(control.div.innerHTML, 'My layer!', "Attribution correct with one layer.");
 
30
        map.addLayer(new OpenLayers.Layer("name", {'attribution':'My layer 2!'}));
 
31
        t.eq(control.div.innerHTML, 'My layer!, My layer 2!', "Attribution correct with two layers.");
 
32
        control.separator = '|';
 
33
        map.addLayer(new OpenLayers.Layer("name",{'attribution':'My layer 3!'}));
 
34
        t.eq(control.div.innerHTML, 'My layer!|My layer 2!|My layer 3!', "Attribution correct with three layers and diff seperator.");
 
35
 
 
36
 
 
37
    }    
 
38
  </script>
 
39
</head>
 
40
<body>
 
41
    <div id="map" style="width: 1024px; height: 512px;"/>
 
42
</body>
 
43
</html>