Do not accept null coordinates in Point constructor

This commit is contained in:
ahocevar
2018-07-07 14:48:46 +02:00
parent da0838dde2
commit c0d04ea077
8 changed files with 31 additions and 44 deletions

View File

@@ -339,14 +339,14 @@ MVT.prototype.createFeature_ = function(pbf, rawFeature, opt_options) {
geom = new Polygon(flatCoordinates, GeometryLayout.XY, ends);
}
} else {
geom = geometryType === GeometryType.POINT ? new Point(null) :
geom = geometryType === GeometryType.POINT ? new Point(flatCoordinates, GeometryLayout.XY) :
geometryType === GeometryType.LINE_STRING ? new LineString(null) :
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) {
if (geometryType !== GeometryType.POLYGON && geometryType !== GeometryType.POINT) {
geom.setFlatCoordinates(GeometryLayout.XY, flatCoordinates, ends);
}
feature = new this.featureClass_();