Prevent Z to be undefined in 3D WFS transactions
For newly created points, Z can be undefined. In these cases, we use 0 for Z.
This commit is contained in:
@@ -471,7 +471,9 @@ ol.format.GML2.prototype.getCoords_ = function(point, opt_srsName, opt_is3D) {
|
|||||||
point[0] + ',' + point[1] :
|
point[0] + ',' + point[1] :
|
||||||
point[1] + ',' + point[0]);
|
point[1] + ',' + point[0]);
|
||||||
if (opt_is3D) {
|
if (opt_is3D) {
|
||||||
coords += ',' + point[2];
|
// For newly created points, Z can be undefined.
|
||||||
|
var z = point[2] || 0;
|
||||||
|
coords += ',' + z;
|
||||||
}
|
}
|
||||||
|
|
||||||
return coords;
|
return coords;
|
||||||
|
|||||||
@@ -580,7 +580,9 @@ ol.format.GML3.prototype.writePos_ = function(node, value, objectStack) {
|
|||||||
coords = (point[1] + ' ' + point[0]);
|
coords = (point[1] + ' ' + point[0]);
|
||||||
}
|
}
|
||||||
if (is3D) {
|
if (is3D) {
|
||||||
coords += ' ' + point[2];
|
// For newly created points, Z can be undefined.
|
||||||
|
var z = point[2] || 0;
|
||||||
|
coords += ' ' + z;
|
||||||
}
|
}
|
||||||
ol.format.XSD.writeStringTextNode(node, coords);
|
ol.format.XSD.writeStringTextNode(node, coords);
|
||||||
};
|
};
|
||||||
@@ -602,7 +604,9 @@ ol.format.GML3.prototype.getCoords_ = function(point, opt_srsName, opt_is3D) {
|
|||||||
point[0] + ' ' + point[1] :
|
point[0] + ' ' + point[1] :
|
||||||
point[1] + ' ' + point[0]);
|
point[1] + ' ' + point[0]);
|
||||||
if (opt_is3D) {
|
if (opt_is3D) {
|
||||||
coords += ' ' + point[2];
|
// For newly created points, Z can be undefined.
|
||||||
|
var z = point[2] || 0;
|
||||||
|
coords += ' ' + z;
|
||||||
}
|
}
|
||||||
|
|
||||||
return coords;
|
return coords;
|
||||||
|
|||||||
Reference in New Issue
Block a user