From b6d57894b40ea96cbc96283449e557f774e0d2f0 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Thu, 7 Mar 2013 00:49:03 +0100 Subject: [PATCH] Add configureProj4jsProjection function so that we can add extent and global parameter to proj4js projections. And remove setExtent method which is not relevant. --- src/ol/projection.exports | 1 + src/ol/projection.js | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/ol/projection.exports b/src/ol/projection.exports index 4ebfcbcd2f..3e39743c12 100644 --- a/src/ol/projection.exports +++ b/src/ol/projection.exports @@ -17,3 +17,4 @@ @exportSymbol ol.projection.getTransformFromCodes @exportSymbol ol.projection.transform @exportSymbol ol.projection.transformWithCodes +@exportSymbol ol.projection.configureProj4jsProjection diff --git a/src/ol/projection.js b/src/ol/projection.js index 859ae9960e..ec0eabf712 100644 --- a/src/ol/projection.js +++ b/src/ol/projection.js @@ -107,14 +107,6 @@ ol.Projection.prototype.getExtent = function() { }; -/** - * @param {ol.Extent} extent Extent. - */ -ol.Projection.prototype.setExtent = function(extent) { - this.extent_ = extent; -}; - - /** * @param {number} resolution Resolution. * @param {ol.Coordinate} point Point. @@ -663,3 +655,14 @@ ol.projection.transformWithCodes = vertex = transformFn(vertex, vertex, 2); return new ol.Coordinate(vertex[0], vertex[1]); }; + + +/** + * @param {ol.Proj4jsProjectionOptions} options Projection config options. + * @return {ol.Proj4jsProjection_} Proj4js projection. + */ +ol.projection.configureProj4jsProjection = function(options) { + goog.asserts.assert(!goog.object.containsKey( + ol.projection.proj4jsProjections_, options.code)); + return ol.projection.getProj4jsProjectionFromCode_(options); +};