diff --git a/src/ol/projection.js b/src/ol/projection.js index 0969b45882..91d00d3fd5 100644 --- a/src/ol/projection.js +++ b/src/ol/projection.js @@ -549,8 +549,9 @@ ol.projection.cloneTransform = function(input, opt_output, opt_dimension) { */ ol.projection.transform = function(point, source, destination) { var transformFn = ol.projection.getTransform(source, destination); - var output = transformFn([point.x, point.y]); - return new ol.Coordinate(output[0], output[1]); + var vertex = [point.x, point.y]; + vertex = transformFn(vertex, vertex, 2); + return new ol.Coordinate(vertex[0], vertex[1]); }; @@ -564,6 +565,7 @@ ol.projection.transformWithCodes = function(point, sourceCode, destinationCode) { var transformFn = ol.projection.getTransformFromCodes( sourceCode, destinationCode); - var output = transformFn([point.x, point.y]); - return new ol.Coordinate(output[0], output[1]); + var vertex = [point.x, point.y]; + vertex = transformFn(vertex, vertex, 2); + return new ol.Coordinate(vertex[0], vertex[1]); };