Fixing GPX parse error
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
4bea4838c8
commit
4dc910ccc4
@ -51,12 +51,12 @@ module.exports = (fastify, opts, done) => {
|
||||
const data = JSON.parse(val);
|
||||
const gen_wpt = (name,desc,latlon,icon="Flag") => `<wpt lat="${latlon[0]}" lon="${latlon[1]}"><ele>0</ele><name>${name}</name><cmt>-</cmt><desc>${desc}</desc><sym>${icon}</sym></wpt>`
|
||||
data.main.forEach(a => {
|
||||
file+= gen_wpt(a.hotel.name, a.hotel.notes, a.hotel.latlon, icon="Hotel");
|
||||
file+= gen_wpt(a.hotel.name, a.hotel.notes.replace("\n","... "), a.hotel.latlon, icon="Hotel");
|
||||
a.places.restaurants.forEach(b => {
|
||||
file+= gen_wpt(b.name, b.notes, b.latlon, icon="Restaurant");
|
||||
file+= gen_wpt(b.name, b.notes.replace("\n","... "), b.latlon, icon="Restaurant");
|
||||
});
|
||||
a.places.activities.forEach(b => {
|
||||
file+= gen_wpt(b.name, b.notes, b.latlon, icon="Tree");
|
||||
file+= gen_wpt(b.name, b.notes.replace("\n","... "), b.latlon, icon="Tree");
|
||||
});
|
||||
});
|
||||
file+="</gpx>";
|
||||
|
Loading…
x
Reference in New Issue
Block a user