From 4fcc00e39c6793045ed9e5d1f4bd2b54f4283591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Wed, 20 Jun 2012 10:28:54 +0200 Subject: [PATCH] move ol.Projection code and units methods to the api dir --- src/api/projection.js | 27 +++++++++++++++++++++++++++ src/ol/Projection.js | 29 ----------------------------- 2 files changed, 27 insertions(+), 29 deletions(-) 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