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

Writing to GPXExtension #64

Closed
andrijamilovanovic opened this issue Nov 14, 2019 · 2 comments · Fixed by #65
Closed

Writing to GPXExtension #64

andrijamilovanovic opened this issue Nov 14, 2019 · 2 comments · Fixed by #65
Labels
bug Something isn't working creating Something about GPXRoot isn't working

Comments

@andrijamilovanovic
Copy link

HI,
I'm trying to add extension with code:

trackpoint.extensions = GPXExtensions()
trackpoint.extensions?.append(at: "gpxtpx:TrackPointExtension", contents: ["gpxtpx:hr":"2"])

Unfortunately, as a result, I'm getting invalid XML where open and closed tags for extensions are not properly paired.

<trk>
	<trkseg>
		<trkpt lat="1.2345" lon="2.3456">
			<ele>31.92492</ele>
			<time>2019-11-14T00:23:45Z</time>
			<extensions>
					<gpxtpx:hr>60</gpxtpx:hr>
					</gpxtpx:hr>
				</gpxtpx:TrackPointExtension>
			</extensions>
		</trkpt>
	</trkseg>
</trk>

I was trying to add dummy attributes to force GPXExtensionsElement into properly generate open tag, but still, I was not able to implement a workaround.

Thanks,
A.

@vincentneo
Copy link
Owner

Hi @andrijamilovanovic,

Sorry that this didn't work as expected. The extensions system is still rather buggy. Hopefully when more people uses it, it will get better, as I tend to overlook at certain bugs.

I think that this has something to do with issue #61. If it was, I should be able to get a fix done within hours.

@vincentneo vincentneo added the bug Something isn't working label Nov 14, 2019
@vincentneo vincentneo added the creating Something about GPXRoot isn't working label Nov 14, 2019
@vincentneo
Copy link
Owner

@andrijamilovanovic
Pull request #65 should fix things up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working creating Something about GPXRoot isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants