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 -3
View File
@@ -444,7 +444,6 @@ GMLBase.prototype.readPolygon = function(node, objectStack) {
const flatLinearRings = pushParseAndPop([null],
this.FLAT_LINEAR_RINGS_PARSERS_, node, objectStack, this);
if (flatLinearRings && flatLinearRings[0]) {
const polygon = new Polygon(null);
const flatCoordinates = flatLinearRings[0];
const ends = [flatCoordinates.length];
let i, ii;
@@ -452,8 +451,7 @@ GMLBase.prototype.readPolygon = 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;
}