Allow flat coordinates for Polygon constructor

This commit is contained in:
ahocevar
2018-07-07 14:16:39 +02:00
parent 9ddd7e4751
commit 1da43d90af
10 changed files with 53 additions and 85 deletions
+1 -4
View File
@@ -247,7 +247,6 @@ GML3.prototype.readSurface_ = function(node, objectStack) {
const flatLinearRings = pushParseAndPop([null],
this.SURFACE_PARSERS_, node, objectStack, this);
if (flatLinearRings && flatLinearRings[0]) {
const polygon = new Polygon(null);
const flatCoordinates = flatLinearRings[0];
const ends = [flatCoordinates.length];
let i, ii;
@@ -255,9 +254,7 @@ GML3.prototype.readSurface_ = function(node, objectStack) {
extend(flatCoordinates, flatLinearRings[i]);
ends.push(flatCoordinates.length);
}
polygon.setFlatCoordinates(
GeometryLayout.XYZ, flatCoordinates, ends);
return polygon;
return new Polygon(flatCoordinates, GeometryLayout.XYZ, ends);
} else {
return undefined;
}