]> dev.renevier.net Git - syp.git/blob - openlayers/tests/Projection.html
fixes notices
[syp.git] / openlayers / tests / Projection.html
1 <html> 
2   <head> 
3     <script src="../lib/OpenLayers.js"></script> 
4     <script type="text/javascript"> 
5      function test_Projection_constructor(t) { 
6          t.plan(9); 
7       
8          var options = {'foo': 'bar'}; 
9          var projection = new OpenLayers.Projection("code", options); 
10          t.ok(projection instanceof OpenLayers.Projection, 
11               "new OpenLayers.Projection returns object" ); 
12          t.eq(projection.projCode, "code", "The proj code is maintained");  
13          t.eq(projection.getCode(), "code", "The proj code is maintained.");  
14          t.eq(projection.getUnits(), null, "Null units with no proj4js library.");  
15          t.eq(projection.foo, "bar", "constructor sets options correctly"); 
16   
17          var projection2 = new OpenLayers.Projection("epsg:4325", options); 
18          out = OpenLayers.Projection.transform({'x':10,'y':12}, projection, projection2); 
19          t.eq(out.x, 10, "Null transform has no effect"); 
20          t.eq(out.y, 12, "Null transform has no effect"); 
21
22          t.eq(projection.equals(null), false, "equals on null projection returns false");
23          t.eq(projection.equals({}), false, "equals on null projection object returns false (doesn't call getCode)");
24      } 
25        
26     </script> 
27   </head> 
28   <body> 
29   </body> 
30 </html>