Merge pull request #3017 from bartvde/format-write-string-example

Use writeFeatures instead of writeFeaturesNode in GPX and KML example (r=@elemoine)
This commit is contained in:
Bart van den Eijnden
2014-12-07 18:14:49 +01:00
3 changed files with 3 additions and 7 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -869,7 +869,7 @@ ol.format.GPX.GPX_SERIALIZERS_ = ol.xml.makeStructureNS(
* @function
* @param {Array.<ol.Feature>} features Features.
* @param {olx.format.WriteOptions=} opt_options Write options.
* @return {Node} Result.
* @return {string} Result.
* @api stable
*/
ol.format.GPX.prototype.writeFeatures;