Last active
March 15, 2018 05:01
-
-
Save hiiamyes/5bbad42ef4ef2eb5b64515be60a92365 to your computer and use it in GitHub Desktop.
HikeJSON & TrailJSON
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
[ | |
{ | |
"type": "node", | |
"node": { | |
"name": "塔塔加登山口", | |
"time": "09:00", | |
"stayTime": 0 | |
} | |
}, | |
{ | |
"type": "path" | |
"path": { | |
"walkTime": 50, | |
"distance": 1700, | |
} | |
}, | |
{ | |
"type": "node", | |
"node": { | |
"name": "孟祿亭", | |
"time": "09:50", | |
"stayTime": 10 | |
} | |
}, | |
{ | |
"type": "path" | |
"path": { | |
"walkTime": 40, | |
"distance": 1000, | |
} | |
}, | |
{ | |
"type": "node", | |
"node": { | |
"name": "玉山前鋒登山口", | |
"time": "10:40", | |
"stayTime": 10 | |
} | |
}, | |
] |
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
updateNodeTime | |
timeDiff = moment.diff() | |
for type node time += timeDiff | |
updateNodeStayTime | |
timeDiff = | |
for type node after this node time += timeDiff | |
updatePathWalkTime | |
timeDiff = | |
for type node after this path time += timeDiff | |
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
{ | |
"name": "yushan", | |
"days": [ | |
{ | |
"day": 1, | |
"date": "2018-02-11", | |
"trailTime": 330, | |
"trailDistance": 8500, | |
"trail": day-1.trailjson | |
}, | |
{ | |
"day": 2, | |
"date": "2018-02-12", | |
"trailTime": 645, | |
"trailDistance": 15300, | |
"trail": day-2.trailjson | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment