Simplify ol.proj.addCoordinateTransforms

Equivalent projections do not need to be handled here, and the forward
and inverse functions can be function arguments instead of being nested
in an object literal.
This commit is contained in:
Andreas Hocevar
2014-07-09 13:11:57 +02:00
parent 90c745006d
commit 0a01f8ef7e
4 changed files with 25 additions and 47 deletions
-27
View File
@@ -274,33 +274,6 @@ olx.OverlayOptions.prototype.stopEvent;
olx.OverlayOptions.prototype.insertFirst;
/**
* Object literal with forward and inverse coordinate transforms.
* @typedef {{forward: function(ol.Coordinate): ol.Coordinate,
* inverse: function(ol.Coordinate): ol.Coordinate}}
* @api
*/
olx.CoordinateTransforms;
/**
* The forward transform function (that is, from the source projection to the
* target projection) that takes a {@link ol.Coordinate} as argument
* and returns the transformed {@link ol.Coordinate}.
* @type {function(ol.Coordinate): ol.Coordinate}
*/
olx.CoordinateTransforms.prototype.forward;
/**
* The inverse transform function (that is, from the target projection to the
* source projection) that takes a {@link ol.Coordinate} as argument
* and returns the transformed {@link ol.Coordinate}.
* @type {function(ol.Coordinate): ol.Coordinate}
*/
olx.CoordinateTransforms.prototype.inverse;
/**
* Object literal with config options for the projection.
* @typedef {{code: string,
+5 -2
View File
@@ -5,9 +5,12 @@
/**
* @type {Function}
* @param {...*} var_args
* @return {undefined|Array.<number>|Object.<{
* forward: function(Array.<number>): Array.<number>,
* inverse: function(Array.<number>): Array.<number>}>}
*/
var proj4 = function() {};
var proj4 = function(var_args) {};
/**