Accept a destination array for transforms

This allows in-place transforms.
This commit is contained in:
Tim Schaub
2013-03-03 20:24:14 +01:00
parent 7a5e6a06d8
commit 40bde4056b
6 changed files with 67 additions and 37 deletions

View File

@@ -2,10 +2,11 @@ goog.provide('ol.TransformFunction');
/**
* A transform function accepts an array of input coordinate values and an
* optional dimension (default should be 2). The function transforms the
* coordinate values and returns an array of the same length as the input.
* A transform function accepts an array of input coordinate values, an optional
* output array, and an optional dimension (default should be 2). The function
* transforms the input coordinate values, populates the output array, and
* returns the output array.
*
* @typedef {function(Array.<number>, number=): Array.<number>}
* @typedef {function(Array.<number>, Array.<number>=, number=): Array.<number>}
*/
ol.TransformFunction;