diff --git a/examples/gpx.js b/examples/gpx.js index fa1b2b0b5c..13024a6a2b 100644 --- a/examples/gpx.js +++ b/examples/gpx.js @@ -105,9 +105,7 @@ if ('download' in exportGPXElement) { clone.getGeometry().transform(projection, 'EPSG:4326'); features.push(clone); }); - var node = new ol.format.GPX().writeFeaturesNode(features); - var string = new XMLSerializer().serializeToString( - /** @type {Node} */ (node)); + var string = new ol.format.GPX().writeFeatures(features); var base64 = exampleNS.strToBase64(string); exportGPXElement.href = 'data:text/gpx+xml;base64,' + base64; diff --git a/examples/kml.js b/examples/kml.js index c3e59404ad..ac86d71adc 100644 --- a/examples/kml.js +++ b/examples/kml.js @@ -73,9 +73,7 @@ if ('download' in exportKMLElement) { clone.getGeometry().transform(projection, 'EPSG:4326'); features.push(clone); }); - var node = new ol.format.KML().writeFeaturesNode(features); - var string = new XMLSerializer().serializeToString( - /** @type {Node} */ (node)); + var string = new ol.format.KML().writeFeatures(features); var base64 = exampleNS.strToBase64(string); exportKMLElement.href = 'data:application/vnd.google-earth.kml+xml;base64,' + base64; diff --git a/src/ol/format/gpxformat.js b/src/ol/format/gpxformat.js index 17652fc171..e37220b8af 100644 --- a/src/ol/format/gpxformat.js +++ b/src/ol/format/gpxformat.js @@ -869,7 +869,7 @@ ol.format.GPX.GPX_SERIALIZERS_ = ol.xml.makeStructureNS( * @function * @param {Array.