facilmap/server/export/gpx-line.ejs

24 wiersze
946 B
Plaintext

<?xml version="1.0" encoding="UTF-8"?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" creator="FacilMap" version="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">
<metadata>
<name><%=line.name || 'FacilMap route'%></name>
<time><%=time%></time>
</metadata>
<<%=useTracks ? 'trk' : 'rte'%>>
<name><%=line.name || 'FacilMap route'%></name>
<% if(desc) { -%>
<desc><%=desc%></desc>
<% } -%>
<% if(useTracks) { -%>
<trkseg>
<% for(let trackPoint of line.trackPoints) { -%>
<trkpt lat="<%=trackPoint.lat%>" lon="<%=trackPoint.lon%>"<% if(trackPoint.ele != null){ %> ele="<%=trackPoint.ele%>"<% } %> />
<% } -%>
</trkseg>
<% } else { -%>
<% for(let routePoint of line.routePoints) { -%>
<rtept lat="<%=routePoint.lat%>" lon="<%=routePoint.lon%>" />
<% } -%>
<% } -%>
</<%=useTracks ? 'trk' : 'rte'%>>
</gpx>