Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError when loading trkseg with only one trkpt #115

Open
Nzara opened this issue Sep 30, 2019 · 1 comment
Open

Uncaught TypeError when loading trkseg with only one trkpt #115

Nzara opened this issue Sep 30, 2019 · 1 comment

Comments

@Nzara
Copy link

Nzara commented Sep 30, 2019

leaflet-omnivore.js:1019 Uncaught TypeError: Cannot read property 'line' of undefined
    at getTrack (leaflet-omnivore.js:1019)
    at Object.gpx (leaflet-omnivore.js:991)
    at gpxParse (leaflet-omnivore.js:213)
    at XMLHttpRequest.onload (leaflet-omnivore.js:114)
    at XMLHttpRequest.loaded (leaflet-omnivore.js:395)

after omnivore.gpx("x.gpx")

The file contains a trkseq with only only one trkpnt. Unfortunately this problem stops reading all other segments too.

<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.1" xmlns="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gte="http://www.gpstrackeditor.com/xmlschemas/General/1" xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1" xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3" targetNamespace="http://www.topografix.com/GPX/1/1" elementFormDefault="qualified" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
<metadata>
	<name>Name</name>
</metadata>
<trk>
	<name>a</name>
	<trkseg>
		<trkpt lat="47.632548" lon="13.002907">
			<ele>628.00</ele>
			<time>2011-09-10T10:59:03Z</time>
		</trkpt>
		<trkpt lat="47.632547" lon="13.003172">
			<ele>627.50</ele>
			<time>2011-09-10T10:59:06Z</time>
		</trkpt>
	</trkseg>
	<trkseg>
		<trkpt lat="47.632492" lon="13.003522">
			<ele>626.50</ele>
			<time>2011-09-10T10:59:10Z</time>
		</trkpt>
	</trkseg>
	<trkseg>
		<trkpt lat="47.632450" lon="13.003592">
			<ele>626.00</ele>
			<time>2011-09-10T10:59:11Z</time>
		</trkpt>
		<trkpt lat="47.632410" lon="13.003725">
			<ele>626.50</ele>
			<time>2011-09-10T10:59:13Z</time>
		</trkpt>
	</trkseg>
</trk>
</gpx>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@Nzara and others