Accept linestrings and flat coordinates in MultiLineString constructor

This commit is contained in:
ahocevar
2018-07-07 17:01:39 +02:00
parent 3871f7785a
commit a09b6c91c9
8 changed files with 44 additions and 78 deletions

View File

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