Allow flat coordinates for Polygon constructor
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user