Giter Club home page Giter Club logo

gpx-for-runners's Introduction

Hi ๐Ÿ‘‹, I'm Tim Benniks

๐Ÿฅ‘ Developer advocate, ๐Ÿง‘โ€๐Ÿ’ป conference speaker, ๐Ÿ‘จโ€๐ŸŽจ content creator

Twitter timbenniks YouTube Subs

Connect with me:

timbenniks timbenniks timbenniks timbenniks timbenniks timbenniks

Languages and Tools:

aws azure bash cypress docker express figma gatsby gcp git graphql gridsome invision javascript jenkins jest nextjs nodejs nuxtjs react selenium sketch vuejs

Support:

timbenniks



gpx-for-runners's People

Contributors

timbenniks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

julienrobidet

gpx-for-runners's Issues

DOMParser not defined

I am trying to user the lib on my backend as follows.

let gpxR = require('gpx-for-runners');
const gpxContent = fs.readFileSync(__dirRoot + '/public/files/gpx/sample.gpx');
const gpx = new gpxR(gpxContent);

When i run it get he following error:

ReferenceError: DOMParser is not defined
at new t (/home/diogo-gocontact/Documents/server/node_modules/gpx-for-runners/lib/gpx.min.js:1:1014)
at /home/diogo-gocontact/Documents/server/controllers/user/user.js:50:23
at /home/diogo-gocontact/Documents/server/node_modules/gpx-parse/lib/gpx-parse.js:179:14
at Parser. (/home/diogo-gocontact/Documents/server/node_modules/xml2js/lib/parser.js:303:18)
at Parser.emit (events.js:159:13)
at SAXParser.onclosetag (/home/diogo-gocontact/Documents/server/node_modules/xml2js/lib/parser.js:261:26)
at emit (/home/diogo-gocontact/Documents/server/node_modules/sax/lib/sax.js:624:35)
at emitNode (/home/diogo-gocontact/Documents/server/node_modules/sax/lib/sax.js:629:5)
at closeTag (/home/diogo-gocontact/Documents/server/node_modules/sax/lib/sax.js:889:7)
at SAXParser.write (/home/diogo-gocontact/Documents/server/node_modules/sax/lib/sax.js:1436:13)
at Parser.exports.Parser.Parser.parseString (/home/diogo-gocontact/Documents/server/node_modules/xml2js/lib/parser.js:322:31)
at Parser.parseString (/home/diogo-gocontact/Documents/server/node_modules/xml2js/lib/parser.js:5:59)
at exports.parseString (/home/diogo-gocontact/Documents/server/node_modules/xml2js/lib/parser.js:354:19)
at Object.exports.parseGpx (/home/diogo-gocontact/Documents/server/node_modules/gpx-parse/lib/gpx-parse.js:154:2)
at /home/diogo-gocontact/Documents/server/node_modules/gpx-parse/lib/gpx-parse.js:200:11
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:528:3)

Can you help me please.

Breaks if a trackpoint is missing an <ele> element.

Some apps (eg. Endomondo) will output .gpx files and not necessarily include elevation data for every single point.

Guessing a conditional inside createJsonFromGpxDom() would do the trick but currently struggling to get the build script to work..

Ionic 3 undefined .textContext

I am trying to user the lib on my ionic 3 app as follows.

import GpxForRunners from 'gpx-for-runners';
...
this._http.get('minitraildocastelo18itra.gpx', { responseType: 'text' }).subscribe( response => {
const gpx = new GpxForRunners (response);
this.distance = gpx.distance();

});

TypeError: Cannot read property 'textContent' of null
at GPX.createJsonFromGpxDom (http://localhost:8100/build/vendor.js:186824:48)
at new GPX (http://localhost:8100/build/vendor.js:186790:30)
at SafeSubscriber._next (http://localhost:8100/build/main.js:771:23)
at SafeSubscriber.__tryOrUnsub (http://localhost:8100/build/vendor.js:37700:16)
at SafeSubscriber.next (http://localhost:8100/build/vendor.js:37647:22)
at Subscriber._next (http://localhost:8100/build/vendor.js:37587:26)
at Subscriber.next (http://localhost:8100/build/vendor.js:37551:18)
at MapSubscriber._next (http://localhost:8100/build/vendor.js:56285:26)
at MapSubscriber.Subscriber.next (http://localhost:8100/build/vendor.js:37551:18)
at FilterSubscriber._next (http://localhost:8100/build/vendor.js:150425:30)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.