Add configureProj4jsProjection function

so that we can add extent and global parameter to proj4js projections.
And remove setExtent method which is not relevant.
This commit is contained in:
Bruno Binet
2013-03-07 00:49:03 +01:00
parent 0e53a3f3c9
commit b6d57894b4
2 changed files with 12 additions and 8 deletions

View File

@@ -17,3 +17,4 @@
@exportSymbol ol.projection.getTransformFromCodes
@exportSymbol ol.projection.transform
@exportSymbol ol.projection.transformWithCodes
@exportSymbol ol.projection.configureProj4jsProjection

View File

@@ -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);
};