diff --git a/src/ol/coordinate.js b/src/ol/coordinate.js index 0ea63e2ce6..c683fda00a 100644 --- a/src/ol/coordinate.js +++ b/src/ol/coordinate.js @@ -319,28 +319,3 @@ ol.coordinate.toStringHDMS = function(coordinate, opt_fractionDigits) { ol.coordinate.toStringXY = function(coordinate, opt_fractionDigits) { return ol.coordinate.format(coordinate, '{x}, {y}', opt_fractionDigits); }; - - -/** - * Create an ol.Coordinate from an Array and take into account axis order. - * - * Examples: - * - * var northCoord = ol.coordinate.fromProjectedArray([1, 2], 'n'); - * // northCoord is now [2, 1] - * - * var eastCoord = ol.coordinate.fromProjectedArray([1, 2], 'e'); - * // eastCoord is now [1, 2] - * - * @param {Array} array The array with coordinates. - * @param {string} axis the axis info. - * @return {ol.Coordinate} The coordinate created. - */ -ol.coordinate.fromProjectedArray = function(array, axis) { - var firstAxis = axis.charAt(0); - if (firstAxis === 'n' || firstAxis === 's') { - return [array[1], array[0]]; - } else { - return array; - } -}; diff --git a/test/spec/ol/coordinate.test.js b/test/spec/ol/coordinate.test.js index f0af6dbb78..215e3ee5d8 100644 --- a/test/spec/ol/coordinate.test.js +++ b/test/spec/ol/coordinate.test.js @@ -232,22 +232,4 @@ describe('ol.coordinate', function() { }); }); - describe('#fromProjectedArray', function() { - it('returns an inverted coord for "n" or "s"', function() { - var northCoord = ol.coordinate.fromProjectedArray([1, 2], 'n'); - var southCoord = ol.coordinate.fromProjectedArray([1, 2], 's'); - expect(northCoord).to.eql([2, 1]); - expect(southCoord).to.eql([2, 1]); - }); - it('returns an unchanged coord for any other "axis"', function() { - var eastCoord = ol.coordinate.fromProjectedArray([1, 2], 'e'); - var westCoord = ol.coordinate.fromProjectedArray([1, 2], 'w'); - var bogusCoord = ol.coordinate.fromProjectedArray([1, 2], 'q'); - var unchangedCoord = ol.coordinate.fromProjectedArray([1, 2], ''); - expect(eastCoord).to.eql([1, 2]); - expect(westCoord).to.eql([1, 2]); - expect(bogusCoord).to.eql([1, 2]); - expect(unchangedCoord).to.eql([1, 2]); - }); - }); });