Accept flat coordinates in LineString constructor

This commit is contained in:
ahocevar
2018-07-07 16:04:43 +02:00
parent c0d04ea077
commit 160f1bc286
14 changed files with 57 additions and 67 deletions

View File

@@ -177,8 +177,7 @@ OSMXML.prototype.readFeaturesFromNode = function(node, opt_options) {
// closed way
geometry = new Polygon(flatCoordinates, GeometryLayout.XY, [flatCoordinates.length]);
} else {
geometry = new LineString(null);
geometry.setFlatCoordinates(GeometryLayout.XY, flatCoordinates);
geometry = new LineString(flatCoordinates, GeometryLayout.XY);
}
transformWithOptions(geometry, false, options);
const feature = new Feature(geometry);