Add GML2 serializer for Point

This commit is contained in:
Julien Enselme
2017-02-17 16:28:52 +01:00
parent dd90c90819
commit f8c6863fa7
2 changed files with 37 additions and 0 deletions

View File

@@ -498,6 +498,16 @@ ol.format.GML2.prototype.writeMultiCurveOrLineString_ = function(node, geometry,
* @private
*/
ol.format.GML2.prototype.writePoint_ = function(node, geometry, objectStack) {
var context = objectStack[objectStack.length - 1];
var srsName = context['srsName'];
if (srsName) {
node.setAttribute('srsName', srsName);
}
var coordinates = this.createCoordinatesNode_(node.namespaceURI);
node.appendChild(coordinates);
var point = geometry.getCoordinates();
var coord = this.getCoords_(point, srsName);
ol.format.XSD.writeStringTextNode(coordinates, coord);
};