mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-08-30 23:30:04 +00:00
allow HTML in wpt desc, and handle link field
This commit is contained in:
@@ -216,7 +216,7 @@ export class GPXFile extends GPXTreeNode<Track>{
|
||||
let file: GPXFileType = {
|
||||
attributes: cloneJSON(this.attributes),
|
||||
metadata: {},
|
||||
wpt: this.wpt,
|
||||
wpt: this.wpt.map((wpt) => wpt.toWaypointType(exclude)),
|
||||
trk: this.trk.map((track) => track.toTrackType(exclude)),
|
||||
rte: [],
|
||||
};
|
||||
@@ -1107,6 +1107,23 @@ export class Waypoint {
|
||||
return this.attributes.lon;
|
||||
}
|
||||
|
||||
toWaypointType(exclude: string[] = []): WaypointType {
|
||||
let wpt: WaypointType = {
|
||||
attributes: this.attributes,
|
||||
ele: this.ele,
|
||||
name: this.name,
|
||||
cmt: this.cmt,
|
||||
desc: this.desc,
|
||||
link: this.link,
|
||||
sym: this.sym,
|
||||
type: this.type,
|
||||
};
|
||||
if (!exclude.includes('time')) {
|
||||
wpt = { ...wpt, time: this.time };
|
||||
}
|
||||
return wpt;
|
||||
}
|
||||
|
||||
clone(): Waypoint {
|
||||
return new Waypoint({
|
||||
attributes: cloneJSON(this.attributes),
|
||||
|
Reference in New Issue
Block a user