Use writeFeatures instead of writeFeaturesNode in GPX and KML example
This commit is contained in:
+1
-3
@@ -105,9 +105,7 @@ if ('download' in exportGPXElement) {
|
|||||||
clone.getGeometry().transform(projection, 'EPSG:4326');
|
clone.getGeometry().transform(projection, 'EPSG:4326');
|
||||||
features.push(clone);
|
features.push(clone);
|
||||||
});
|
});
|
||||||
var node = new ol.format.GPX().writeFeaturesNode(features);
|
var string = new ol.format.GPX().writeFeatures(features);
|
||||||
var string = new XMLSerializer().serializeToString(
|
|
||||||
/** @type {Node} */ (node));
|
|
||||||
var base64 = exampleNS.strToBase64(string);
|
var base64 = exampleNS.strToBase64(string);
|
||||||
exportGPXElement.href =
|
exportGPXElement.href =
|
||||||
'data:text/gpx+xml;base64,' + base64;
|
'data:text/gpx+xml;base64,' + base64;
|
||||||
|
|||||||
+1
-3
@@ -73,9 +73,7 @@ if ('download' in exportKMLElement) {
|
|||||||
clone.getGeometry().transform(projection, 'EPSG:4326');
|
clone.getGeometry().transform(projection, 'EPSG:4326');
|
||||||
features.push(clone);
|
features.push(clone);
|
||||||
});
|
});
|
||||||
var node = new ol.format.KML().writeFeaturesNode(features);
|
var string = new ol.format.KML().writeFeatures(features);
|
||||||
var string = new XMLSerializer().serializeToString(
|
|
||||||
/** @type {Node} */ (node));
|
|
||||||
var base64 = exampleNS.strToBase64(string);
|
var base64 = exampleNS.strToBase64(string);
|
||||||
exportKMLElement.href =
|
exportKMLElement.href =
|
||||||
'data:application/vnd.google-earth.kml+xml;base64,' + base64;
|
'data:application/vnd.google-earth.kml+xml;base64,' + base64;
|
||||||
|
|||||||
@@ -869,7 +869,7 @@ ol.format.GPX.GPX_SERIALIZERS_ = ol.xml.makeStructureNS(
|
|||||||
* @function
|
* @function
|
||||||
* @param {Array.<ol.Feature>} features Features.
|
* @param {Array.<ol.Feature>} features Features.
|
||||||
* @param {olx.format.WriteOptions=} opt_options Write options.
|
* @param {olx.format.WriteOptions=} opt_options Write options.
|
||||||
* @return {Node} Result.
|
* @return {string} Result.
|
||||||
* @api stable
|
* @api stable
|
||||||
*/
|
*/
|
||||||
ol.format.GPX.prototype.writeFeatures;
|
ol.format.GPX.prototype.writeFeatures;
|
||||||
|
|||||||
Reference in New Issue
Block a user