togpx
togpx copied to clipboard
Merge of #11 - Allow customisation by transformers
This is a merge of PR #11 to current master.
From review comments:
- rebase the code onto current master and fix the merge conflicts
Done in 5c88fd4.
the ; is superfluous here, right? (as it's the end of the mapFeature function definition) 2. modify the logic in the defaults helper method, so that it matches ES6's Object.assign (just removing the if condition should do the trick), rename it to assign (or so) and use it also override the default options at the very beginning of the code
Done in 95f4bf7, I kept the if condition but reversed the logic to match Object.assign (see e.g. MDN polyfill) and options init.
I also added two additional changes, to not set feature name, etc. on every trkpt/rtept (46c5e84) and to order rte before trk (4199a90).
- document the new functionality in the project's readme, i.e. the new options (gpx.* flags and transforms) and maybe a dedicated chapter about how to use the transforms with one or two examples.
Still to be done, maybe later, but also wouldn't mind if someone else did.