首页 > 解决方案 > 格式 GPX.writeFeatures 不写入特征节点

问题描述

我正在尝试使用 ol/format/GPX.writeFeatures() 从 LineString 功能生成 gpx,但仅获取 gpx 标头:

<gpx xmlns="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd" version="1.1" creator="OpenLayers"/>

没有特征的节点。

作为测试,我添加了:

let gpx = new GPX();
console.log(features[0]);
console.log(gpx.writeFeatures(features[0]));

到 displayFeatureInfo 函数中的GPX 数据示例index.js。

我错过了什么吗?

标签: openlayersgpx

解决方案


推荐阅读