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

@@ -340,13 +340,13 @@ MVT.prototype.createFeature_ = function(pbf, rawFeature, opt_options) {
}
} else {
geom = geometryType === GeometryType.POINT ? new Point(flatCoordinates, GeometryLayout.XY) :
geometryType === GeometryType.LINE_STRING ? new LineString(null) :
geometryType === GeometryType.LINE_STRING ? new LineString(flatCoordinates, GeometryLayout.XY) :
geometryType === GeometryType.POLYGON ? new Polygon(flatCoordinates, GeometryLayout.XY, ends) :
geometryType === GeometryType.MULTI_POINT ? new MultiPoint (null) :
geometryType === GeometryType.MULTI_LINE_STRING ? new MultiLineString(null) :
null;
}
if (geometryType !== GeometryType.POLYGON && geometryType !== GeometryType.POINT) {
if (geometryType !== GeometryType.POLYGON && geometryType !== GeometryType.LINE_STRING && geometryType !== GeometryType.POINT) {
geom.setFlatCoordinates(GeometryLayout.XY, flatCoordinates, ends);
}
feature = new this.featureClass_();