Merge pull request #913 from tschaub/dimension

Allow for vector data with unknown or inconsistent dimension.
This commit is contained in:
Tim Schaub
2013-08-26 05:59:50 -07:00
5 changed files with 22 additions and 29 deletions

View File

@@ -71,14 +71,9 @@ ol.geom.SharedVertices.prototype.add = function(vertices) {
var vertex, index;
for (var i = 0; i < count; ++i) {
vertex = vertices[i];
goog.asserts.assert(vertex.length == dimension);
if (!offset) {
Array.prototype.push.apply(this.coordinates, vertex);
} else {
index = start + (i * dimension);
for (var j = 0; j < dimension; ++j) {
this.coordinates[index + j] = vertex[j] - offset[j];
}
index = start + (i * dimension);
for (var j = 0; j < dimension; ++j) {
this.coordinates[index + j] = vertex[j] - (offset ? offset[j] : 0);
}
}
var length = this.starts_.push(start);