From 0fef608683bd867a6938ab9262b7c23ec0c03320 Mon Sep 17 00:00:00 2001 From: Bart van den Eijnden Date: Sun, 7 Dec 2014 17:50:39 +0100 Subject: [PATCH] Use writeFeatures instead of writeFeaturesNode in GPX and KML example --- examples/gpx.js | 4 +--- examples/kml.js | 4 +--- src/ol/format/gpxformat.js | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) 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.} features Features. * @param {olx.format.WriteOptions=} opt_options Write options. - * @return {Node} Result. + * @return {string} Result. * @api stable */ ol.format.GPX.prototype.writeFeatures;