Created
July 1, 2017 02:38
-
-
Save ismnoiet/ab97b840ebc8a7280b23a945389db2b1 to your computer and use it in GitHub Desktop.
genereate gpx file to simulate location one iPhone device using xcode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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