sports-lib
sports-lib copied to clipboard
Using xmldom as default DOMParser
This library has been of great help, but the guide should be clear that in NodeJS usage, another DOMParser (e.g. xmldom) should be included as an argument in 'importFromGPX()'. Had to trawl the importer js files to find out.
In the case of Node JS:
npm i xmldom
import {SportsLib} from '@sports-alliance/sports-lib';
import { DOMParser } from 'xmldom'
// For GPX you need a string
const gpxString = 'Some string from a file etc';
SportsLib.importFromGPX(gpxString, DOMParser).then((event)=>{
...
});
Thank you very much for taking the time to report this. A PR is welcome, as I am on vacation atm
Thanks again and may you have a great week