diff --git a/src/ol/base/extent.js b/src/ol/base/extent.js index 2e82fcba09..dc6288ae7b 100644 --- a/src/ol/base/extent.js +++ b/src/ol/base/extent.js @@ -49,11 +49,11 @@ ol.Extent.prototype.clone = function() { /** - * @param {ol.TransformFunction} transform Transform. + * @param {ol.TransformFunction} transformFn Transform function. * @return {ol.Extent} Extent. */ -ol.Extent.prototype.transform = function(transform) { - var min = transform(new ol.Coordinate(this.minX, this.minY)); - var max = transform(new ol.Coordinate(this.maxX, this.maxY)); +ol.Extent.prototype.transform = function(transformFn) { + var min = transformFn(new ol.Coordinate(this.minX, this.minY)); + var max = transformFn(new ol.Coordinate(this.maxX, this.maxY)); return new ol.Extent(min.x, min.y, max.x, max.y); }; diff --git a/src/ol/base/extent_test.js b/src/ol/base/extent_test.js index 4cf509f607..4a5554e9ec 100644 --- a/src/ol/base/extent_test.js +++ b/src/ol/base/extent_test.js @@ -16,9 +16,10 @@ function testClone() { function testTransform() { - var transform = ol.Projection.getTransformFromCodes('EPSG:4326', 'EPSG:3857'); + var transformFn = + ol.Projection.getTransformFromCodes('EPSG:4326', 'EPSG:3857'); var sourceExtent = new ol.Extent(-15, -30, 45, 60); - var destinationExtent = sourceExtent.transform(transform); + var destinationExtent = sourceExtent.transform(transformFn); assertNotNullNorUndefined(destinationExtent); // FIXME check values with third-party tool assertRoughlyEquals(-1669792.3618991037, destinationExtent.minX, 1e-9); diff --git a/src/ol/base/projection.js b/src/ol/base/projection.js index 84ce030a80..66e1f24424 100644 --- a/src/ol/base/projection.js +++ b/src/ol/base/projection.js @@ -140,9 +140,9 @@ ol.Projection.addProjections = function(projections) { /** * @param {ol.Projection} source Source. * @param {ol.Projection} destination Destination. - * @param {ol.TransformFunction} transform Transform. + * @param {ol.TransformFunction} transformFn Transform. */ -ol.Projection.addTransform = function(source, destination, transform) { +ol.Projection.addTransform = function(source, destination, transformFn) { var projections = ol.Projection.projections_; var sourceCode = source.getCode(); goog.asserts.assert(goog.object.containsKey(projections, sourceCode)); @@ -154,7 +154,7 @@ ol.Projection.addTransform = function(source, destination, transform) { } goog.asserts.assert( !goog.object.containsKey(transforms[sourceCode], destinationCode)); - transforms[sourceCode][destinationCode] = transform; + transforms[sourceCode][destinationCode] = transformFn; }; @@ -180,8 +180,8 @@ ol.Projection.equivalent = function(projection1, projection2) { } else if (projection1.getUnits() != projection2.getUnits()) { return false; } else { - var transform = ol.Projection.getTransform(projection1, projection2); - return transform === ol.Projection.cloneTransform; + var transformFn = ol.Projection.getTransform(projection1, projection2); + return transformFn === ol.Projection.cloneTransform; } }; @@ -239,8 +239,8 @@ ol.Projection.cloneTransform = function(point) { * @return {ol.Coordinate} Point. */ ol.Projection.transform = function(point, source, destination) { - var transform = ol.Projection.getTransform(source, destination); - return transform(point); + var transformFn = ol.Projection.getTransform(source, destination); + return transformFn(point); }; @@ -252,9 +252,9 @@ ol.Projection.transform = function(point, source, destination) { */ ol.Projection.transformWithCodes = function(point, sourceCode, destinationCode) { - var transform = ol.Projection.getTransformFromCodes( + var transformFn = ol.Projection.getTransformFromCodes( sourceCode, destinationCode); - return transform(point); + return transformFn(point); }; diff --git a/src/ol/tile/tileurlfunction.js b/src/ol/tile/tileurlfunction.js index fb1825393b..6a68d92821 100644 --- a/src/ol/tile/tileurlfunction.js +++ b/src/ol/tile/tileurlfunction.js @@ -64,17 +64,17 @@ ol.TileUrlFunction.nullTileUrlFunction = function(tileCoord) { /** - * @param {function(ol.TileCoord): ol.TileCoord} transform Transform. + * @param {function(ol.TileCoord): ol.TileCoord} transformFn Transform.function. * @param {ol.TileUrlFunctionType} tileUrlFunction Tile URL function. * @return {ol.TileUrlFunctionType} Tile URL function. */ ol.TileUrlFunction.withTileCoordTransform = - function(transform, tileUrlFunction) { + function(transformFn, tileUrlFunction) { return function(tileCoord) { if (goog.isNull(tileCoord)) { return undefined; } else { - return tileUrlFunction(transform(tileCoord)); + return tileUrlFunction(transformFn(tileCoord)); } }; };