]> dev.renevier.net Git - syp.git/blob - openlayers/tests/Format/WMSCapabilities/v1_1_1.html
initial commit
[syp.git] / openlayers / tests / Format / WMSCapabilities / v1_1_1.html
1 <html> 
2 <head> 
3     <script src="../../../lib/OpenLayers.js"></script>
4     <script src="v1_1_1.js"></script>
5     <script type="text/javascript">
6     
7     function test_read(t) {
8         
9         t.plan(13);
10         
11         var format = new OpenLayers.Format.WMSCapabilities();
12         var obj = format.read(doc);
13         
14         var capability = obj.capability;
15         t.ok(capability, "object contains capability property");
16         
17         var getmap = capability.request.getmap;
18         t.eq(getmap.formats.length, 28, "getmap formats parsed");
19         t.eq(
20             getmap.href,
21             "http://publicus.opengeo.org:80/geoserver/wms?SERVICE=WMS&",
22             "getmap href parsed"
23         );
24         
25         t.ok(capability.layers, "layers parsed");
26         t.eq(capability.layers.length, 22, "correct number of layers parsed");
27         
28         var layer = capability.layers[2];
29         t.eq(layer.name, "tiger:tiger_roads", "[2] correct layer name");
30         t.eq(layer.title, "Manhattan (NY) roads", "[2] correct layer title");
31         t.eq(
32             layer["abstract"],
33             "Highly simplified road layout of Manhattan in New York..",
34             "[2] correct layer abstract"
35         );
36         t.eq(
37             layer.llbbox,
38             [-74.08769307536667, 40.660618924633326, -73.84653192463333, 40.90178007536667],
39             "[2] correct layer bbox"
40         );
41         t.eq(layer.styles.length, 1, "[2] correct styles length");
42         t.eq(layer.styles[0].name, "tiger_roads", "[2] correct style name");
43         t.eq(
44             layer.styles[0].legend.href,
45             "http://publicus.opengeo.org:80/geoserver/wms/GetLegendGraphic?VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=tiger:tiger_roads",
46             "[2] correct legend url"
47         );
48         t.eq(layer.queryable, true, "[2] correct queryable attribute");
49         
50     }
51     
52     
53     </script> 
54 </head> 
55 <body>
56 </body> 
57 </html>