Class GpxParser

Parser to transform a gpx file into a Travel object

Source : file core/lib/GpxParser.js at line 42

Constructor

new GpxParser ( )

The constructor

Source : file core/lib/GpxParser.js at line 361

Public methods

parse ( gpxString )

Parse a gpx string and load the data found in the gpx in a Travel Object

Source : file core/lib/GpxParser.js at line 371

Parameters

Name Type Description
gpxString String

The string to parse

Returns

A travel cpmpleted with Routes and Notes found in the gpx string
Type : Travel

Private properties

#gpxDocument : XMLDocument

The gpx document

Source : file core/lib/GpxParser.js at line 49

#isNodeNetwork : Boolean

A boolean set to true when the gpx file comes from a node network

Source : file core/lib/GpxParser.js at line 70

#route : Route

The currently loaded Route

Source : file core/lib/GpxParser.js at line 63

#travel : Travel

The destination Travel

Source : file core/lib/GpxParser.js at line 56

Private methods

#addWptNote ( wayPoint )

Add a note at the same position than a way node (only for node networks gpx files)

Source : file core/lib/GpxParser.js at line 233

Parameters

Name Type Description
wayPoint WayPoint

The wayPoint for witch a Note must be created

#computeAscentAndDescent ( )

Compute the ascent and descent of the currently parsed Route

Source : file core/lib/GpxParser.js at line 119

#computeRouteDistances ( route )

This method compute the route, itineraryPoints and maneuvers distances

Source : file core/lib/GpxParser.js at line 313

Parameters

Name Type Description
route Route

The route for witch the distances are computed

#createWayPoints ( )

Add a starting and an ending waypoint on each route of the parsed Travel

Source : file core/lib/GpxParser.js at line 293

#nearestItineraryPointObjId ( latLng )

Search the nearest ItineraryPoint objId of the currently parsed route from a given point

Source : file core/lib/GpxParser.js at line 168

Parameters

Name Type Description
latLng Array of Number

The lat and lng of the given point

#parseRteNode ( rteNode )

Parse a rte xml node

Source : file core/lib/GpxParser.js at line 212

Parameters

Name Type Description
rteNode Node

A Node with a rte tag

#parseRtePtNode ( rtePtNode )

Parse a rtept xml node

Source : file core/lib/GpxParser.js at line 188

Parameters

Name Type Description
rtePtNode Node

A Node with a rtept tag

#parseTrkNode ( trkNode )

Parse a trk xml node

Source : file core/lib/GpxParser.js at line 142

Parameters

Name Type Description
trkNode Node

A Node with a trk tag

#parseTrkPtNode ( trkPtNode )

Parse a trkpt xml node

Source : file core/lib/GpxParser.js at line 77

Parameters

Name Type Description
trkPtNode Node

A Node with a trkpt tag

#parseTrkSegNode ( trkSegNode )

Parse a trkseg xml node

Source : file core/lib/GpxParser.js at line 102

Parameters

Name Type Description
trkSegNode Node

A Node with a trkseg tag

#parseWptNode ( wptNode )

Parse a wpt xml node

Source : file core/lib/GpxParser.js at line 257

Parameters

Name Type Description
wptNode Node

A Node with a wpt tag

#parseWptNodes ( wptNodes )

Parse a NodeList of wpt xml node

Source : file core/lib/GpxParser.js at line 283

Parameters

Name Type Description
wptNodes NodeList

A NodeList of Nodes with a wpt tag