Files
openlayers/tests/test_Projection.html
Frédéric Junod 22bbf98398 Include tests/test_Projection.html and lib/OpenLayers/Projection.js (taken from
projections.2.patch). (Closes #1035)



git-svn-id: http://svn.openlayers.org/trunk/openlayers@5405 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-12-14 08:36:36 +00:00

28 lines
1.1 KiB
HTML

<html>
<head>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
function test_01_Projection_constructor(t) {
t.plan(7);
var options = {'foo': 'bar'};
var projection = new OpenLayers.Projection("code", options);
t.ok(projection instanceof OpenLayers.Projection,
"new OpenLayers.Projection returns object" );
t.eq(projection.projCode, "code", "The proj code is maintained");
t.eq(projection.getCode(), "code", "The proj code is maintained.");
t.eq(projection.getUnits(), null, "Null units with no proj4js library.");
t.eq(projection.foo, "bar", "constructor sets options correctly");
var projection2 = new OpenLayers.Projection("epsg:4325", options);
out = OpenLayers.Projection.transform({'x':10,'y':12}, projection, projection2);
t.eq(out.x, 10, "Null transform has no effect");
t.eq(out.y, 12, "Null transform has no effect");
}
</script>
</head>
<body>
</body>
</html>