Skip to content

Instantly share code, notes, and snippets.

@ismnoiet
Created July 1, 2017 02:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ismnoiet/ab97b840ebc8a7280b23a945389db2b1 to your computer and use it in GitHub Desktop.
Save ismnoiet/ab97b840ebc8a7280b23a945389db2b1 to your computer and use it in GitHub Desktop.
genereate gpx file to simulate location one iPhone device using xcode
// 1. find location latitude & longitude of desired location and name of location
// 2. call generate_gpx using previous data
// alternative, you can use http://gpx-poi.com to generate .gpx file
function generate_gpx(lat,lon,name,time='2017-07-01T02:24:02Z'){
return `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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="gpx-poi.com">
<wpt lat="${lat}" lon="${lon}">
<time>${time}</time>
<name>${name}</name>
</wpt>
</gpx>`;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment