3 <script src="../lib/OpenLayers.js"></script>
4 <script type="text/javascript">
6 function test_Renderer_constructor(t) {
8 var el = document.body;
10 var r = new OpenLayers.Renderer(el.id);
12 t.ok(r instanceof OpenLayers.Renderer, "new OpenLayers.Renderer returns Renderer object" );
13 t.ok(r.container == el, "renderer container is correctly set");
16 function test_Renderer_supported(t) {
19 var r = new OpenLayers.Renderer();
20 t.eq(r.supported(), false, "supported returns false by default");
23 function test_Renderer_setextent(t) {
26 var r = new OpenLayers.Renderer();
27 var extent = new OpenLayers.Bounds(1,2,3,4);
29 r.setExtent(extent, true);
30 t.ok(r.extent.equals(extent), "extent is correctly set");
31 t.eq(r.resolution, null, "resolution nullified");
34 function test_Renderer_setsize(t) {
37 var r = new OpenLayers.Renderer();
38 var size = new OpenLayers.Size(1,2);
41 t.ok(r.size.equals(size), "size is correctly set");
42 t.eq(r.resolution, null, "resolution nullified");
45 function test_Renderer_getresolution(t) {
48 var r = new OpenLayers.Renderer();
49 var map = new OpenLayers.Map("map");
51 var resolution = r.getResolution();
52 t.eq(resolution, map.getResolution(), "resolution matches the map resolution");
53 t.eq(r.resolution, resolution, "resolution is correctly set");
56 function test_Renderer_destroy(t) {
59 var r = new OpenLayers.Renderer();
60 r.container = document.createElement("div");
61 r.extent = new OpenLayers.Bounds(1,2,3,4);
62 r.size = new OpenLayers.Size(1,2);
68 t.eq(r.container, null, "container nullified");
69 t.eq(r.extent, null, "extent nullified");
70 t.eq(r.size, null, "size nullified");
71 t.eq(r.resolution, null, "resolution nullified");
72 t.eq(r.map, null, "map nullified");
78 <div id="map" style="width:500px;height:550px"></div>