diff --git a/src/ol/format/gpxformat.js b/src/ol/format/gpxformat.js index 0c16ddbdbf..034c1caf60 100644 --- a/src/ol/format/gpxformat.js +++ b/src/ol/format/gpxformat.js @@ -1,5 +1,5 @@ goog.provide('ol.format.GPX'); -goog.provide('ol.format.GPX.v1_1'); +goog.provide('ol.format.GPX.V1_1'); goog.require('goog.array'); goog.require('goog.asserts'); @@ -652,7 +652,7 @@ ol.format.GPX.TRK_SERIALIZERS_ = ol.xml.makeStructureNS( * @param {*} value Value. * @param {Array.<*>} objectStack Object stack. * @param {string=} opt_nodeName Node name. - * @return {Node} Node. + * @return {Node|undefined} Node. * @private */ ol.format.GPX.TRKSEG_NODE_FACTORY_ = ol.xml.makeSimpleNodeFactory('trkpt'); @@ -730,7 +730,7 @@ ol.format.GPX.GEOMETRY_TYPE_TO_NODENAME_ = { * @param {*} value Value. * @param {Array.<*>} objectStack Object stack. * @param {string=} opt_nodeName Node name. - * @return {Node} Node. + * @return {Node|undefined} Node. * @private */ ol.format.GPX.GPX_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) { diff --git a/src/ol/xml.js b/src/ol/xml.js index e8034e8bfc..f682ec64fc 100644 --- a/src/ol/xml.js +++ b/src/ol/xml.js @@ -425,7 +425,7 @@ ol.xml.makeArraySerializer = function(nodeWriter, opt_this) { * @param {string=} opt_namespaceURI Fixed namespace URI which will be used for * all created nodes. If not provided, the namespace of the parent node will * be used. - * @return {function(*, Array.<*>, string=): Node} Node factory. + * @return {function(*, Array.<*>, string=): (Node|undefined)} Node factory. */ ol.xml.makeSimpleNodeFactory = function(opt_nodeName, opt_namespaceURI) { var fixedNodeName = opt_nodeName; @@ -458,7 +458,7 @@ ol.xml.makeSimpleNodeFactory = function(opt_nodeName, opt_namespaceURI) { * `nodeName` passed by {@link ol.xml.serialize} or * {@link ol.xml.pushSerializeAndPop} to the node factory. * @const - * @type {function(*, Array.<*>, string=): Node} + * @type {function(*, Array.<*>, string=): (Node|undefined)} */ ol.xml.OBJECT_PROPERTY_NODE_FACTORY = ol.xml.makeSimpleNodeFactory(); @@ -551,7 +551,7 @@ ol.xml.pushParseAndPop = function( * Walks through an array of `values` and calls a serializer for each value. * @param {Object.>} serializersNS * Namespaced serializers. - * @param {function(this: T, *, Array.<*>, (string|undefined)): Node|undefined} nodeFactory + * @param {function(this: T, *, Array.<*>, (string|undefined)): (Node|undefined)} nodeFactory * Node factory. The `nodeFactory` creates the node whose namespace and name * will be used to choose a node writer from `serializersNS`. This * separation allows us to decide what kind of node to create, depending on @@ -591,7 +591,7 @@ ol.xml.serialize = function( * @param {O} object Object. * @param {Object.>} serializersNS * Namespaced serializers. - * @param {function(this: T, *, Array.<*>, (string|undefined)): Node|undefined} nodeFactory + * @param {function(this: T, *, Array.<*>, (string|undefined)): (Node|undefined)} nodeFactory * Node factory. The `nodeFactory` creates the node whose namespace and name * will be used to choose a node writer from `serializersNS`. This * separation allows us to decide what kind of node to create, depending on diff --git a/test/spec/ol/format/gpxformat.test.js b/test/spec/ol/format/gpxformat.test.js index bb9fa2bc22..5428bae0ba 100644 --- a/test/spec/ol/format/gpxformat.test.js +++ b/test/spec/ol/format/gpxformat.test.js @@ -401,6 +401,7 @@ describe('ol.format.GPX', function() { goog.require('ol.Feature'); goog.require('ol.format.GPX'); +goog.require('ol.format.GPX.V1_1'); goog.require('ol.geom.LineString'); goog.require('ol.geom.MultiLineString'); goog.require('ol.geom.Point');