A passing test.

This commit is contained in:
Tim Schaub
2012-06-19 11:14:53 +02:00
parent b1e26fab1d
commit 77c07a500e
6 changed files with 26 additions and 35 deletions

View File

@@ -15,20 +15,25 @@ ol.ProjectionLike;
* @return {ol.Projection} Projection.
*/
ol.projection = function(opt_arg){
var code;
if (arguments.length == 1) {
var code, units;
if (arguments.length == 1 && goog.isDef(opt_arg)) {
if (opt_arg instanceof ol.Projection) {
return opt_arg;
}
else
if (goog.isString(arguments[0])) {
code = arguments[0];
}
else {
throw new Error('ol.projection');
}
else if (goog.isString(opt_arg)) {
code = opt_arg;
}
else if (goog.isObject(opt_arg)) {
code = opt_arg['code'];
units = opt_arg['units'];
}
else {
throw new Error('ol.projection');
}
}
return new ol.Projection(code);
var proj = new ol.Projection();
proj.setCode(code);
return proj;
};