Allow geometries to use a shared vertex array

The ol.geom.SharedVertices structure represents a flattened array of vertex coordinates.  This is intended to support optimal WebGL rendering.
This commit is contained in:
Tim Schaub
2013-03-02 18:39:24 +01:00
parent bdfa2cc88c
commit b52d283641
23 changed files with 1086 additions and 217 deletions
+8 -14
View File
@@ -17,20 +17,6 @@ describe('ol.geom.LinearRing', function() {
});
describe('#coordinates', function() {
it('is an array', function() {
var ring = new ol.geom.LinearRing([[10, 20], [30, 40]]);
expect(ring.coordinates.length).toBe(4);
expect(ring.coordinates[0]).toBe(10);
expect(ring.coordinates[1]).toBe(20);
expect(ring.coordinates[2]).toBe(30);
expect(ring.coordinates[3]).toBe(40);
});
});
describe('#dimension', function() {
it('can be 2', function() {
@@ -45,6 +31,14 @@ describe('ol.geom.LinearRing', function() {
});
describe('#getCoordinates()', function() {
it('is an array', function() {
var ring = new ol.geom.LinearRing([[10, 20], [30, 40]]);
expect(ring.getCoordinates()).toEqual([[10, 20], [30, 40]]);
});
});
});