Do not accept null coordinates in Point constructor
This commit is contained in:
@@ -291,9 +291,7 @@ GMLBase.prototype.readFeatureElement = function(node, objectStack) {
|
||||
GMLBase.prototype.readPoint = function(node, objectStack) {
|
||||
const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);
|
||||
if (flatCoordinates) {
|
||||
const point = new Point(null);
|
||||
point.setFlatCoordinates(GeometryLayout.XYZ, flatCoordinates);
|
||||
return point;
|
||||
return new Point(flatCoordinates, GeometryLayout.XYZ);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1144,8 +1144,7 @@ function readPoint(node, objectStack) {
|
||||
const flatCoordinates =
|
||||
readFlatCoordinatesFromNode(node, objectStack);
|
||||
if (flatCoordinates) {
|
||||
const point = new Point(null);
|
||||
point.setFlatCoordinates(GeometryLayout.XYZ, flatCoordinates);
|
||||
const point = new Point(flatCoordinates, GeometryLayout.XYZ);
|
||||
point.setProperties(properties);
|
||||
return point;
|
||||
} else {
|
||||
|
||||
@@ -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_();
|
||||
|
||||
Reference in New Issue
Block a user