Add ol.geom.{in,de}flateCoordinates
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
goog.provide('ol.test.geom');
|
||||
|
||||
|
||||
describe('ol.geom', function() {
|
||||
|
||||
describe('ol.geom.deflateCoordinates', function() {
|
||||
|
||||
var flatCoordinates;
|
||||
beforeEach(function() {
|
||||
flatCoordinates = [];
|
||||
});
|
||||
|
||||
it('flattens coordinates', function() {
|
||||
var offset = ol.geom.deflateCoordinates(
|
||||
flatCoordinates, 0, [[1, 2], [3, 4]], 2);
|
||||
expect(offset).to.be(4);
|
||||
expect(flatCoordinates).to.eql([1, 2, 3, 4]);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('ol.geom.inflateCoordinates', function() {
|
||||
|
||||
it('inflates coordinates', function() {
|
||||
var coordinates = ol.geom.inflateCoordinates([1, 2, 3, 4], 0, 4, 2);
|
||||
expect(coordinates).to.eql([[1, 2], [3, 4]]);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user