diff --git a/src/api/projection.js b/src/api/projection.js index 19150f2308..085d98022c 100644 --- a/src/api/projection.js +++ b/src/api/projection.js @@ -45,3 +45,30 @@ ol.projection = function(opt_arg){ return proj; }; +/** + * @export + * @param {string=} opt_code Code. + * @return {!ol.Projection|string} Result. + */ +ol.Projection.prototype.code = function(opt_code){ + if (arguments.length == 1 && goog.isDef(opt_code)) { + return this.setCode(opt_code); + } + else { + return this.getCode(); + } +}; + +/** + * @export + * @param {string=} opt_units Units abbreviation. + * @return {undefined|!ol.Projection|string} Result. + */ +ol.Projection.prototype.units = function(opt_units){ + if (goog.isDef(opt_units)) { + return this.setUnits(opt_units); + } + else { + return this.getUnits(); + } +}; diff --git a/src/ol/Projection.js b/src/ol/Projection.js index 43d0e64a04..a4fab80524 100644 --- a/src/ol/Projection.js +++ b/src/ol/Projection.js @@ -50,20 +50,6 @@ ol.Projection.prototype.setCode = function(code) { return this; }; -/** - * @export - * @param {string=} opt_code Code. - * @return {!ol.Projection|string} Result. - */ -ol.Projection.prototype.code = function(opt_code){ - if (arguments.length == 1 && goog.isDef(opt_code)) { - return this.setCode(opt_code); - } - else { - return this.getCode(); - } -}; - /** * @return {string|undefined} Units abbreviation. */ @@ -98,21 +84,6 @@ ol.Projection.prototype.setExtent = function(extent) { return this; }; -/** - * @export - * @param {string=} opt_units Units abbreviation. - * @return {undefined|!ol.Projection|string} Result. - * TODO: move to api folder - */ -ol.Projection.prototype.units = function(opt_units){ - if (goog.isDef(opt_units)) { - return this.setUnits(opt_units); - } - else { - return this.getUnits(); - } -}; - /** * Transforms is an object, with from properties, each of which may * have a to property. This allows you to define projections without