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

First style information is used for all segments #120

Open
cyclingcat opened this issue Jul 1, 2021 · 1 comment
Open

First style information is used for all segments #120

cyclingcat opened this issue Jul 1, 2021 · 1 comment

Comments

@cyclingcat
Copy link

Hi there,

first of all thank you for this excellent Leaflet plugin. Exactly what I need for visualising my Garmin GPX tracks on a OSM-based map and straightforward to use. 👍

I'm currently fiddling around with the various possibilities this plugin offers, including the possibility to process GPX style information. According to your documentation the <extensions> tag is a child of the <trkseg> tag. It generally works this way, however, if there is more than one <trkseg> element and I put different stylings into each of the segments, the style of the first <trkseg> is applied to the whole track. The <extensions> elements of the other sections seem to be ignored although I have set gpx_options: {joinTrackSegments: false} when creating the GPX object.

If I delete the whole <extensions> element inside the first <trkseg> element, the next <extensions> inside a <trkseg> element will be applied to the whole track. It seems as if always the first <extensions> element found in the GPX file gets applied to the track no matter of the surrounding <trkseg> element.

Is this a bug?

The cycling cat

@cyclingcat
Copy link
Author

Okay, it was partly my fault. I accidentally used a very similar looking colour for the second <trkseg> (I should definitely buy new glasses! 😆) If each <trkseg> contains its own <extensions> element, it works as described. However, if the first <trkseg> doesn't contain an <extensions> element while the second does, the latter one gets applied to the first <trkseg> as well. One would expect that the default values (i. e. a blue line) would be applied for a segment without style information.

The cycling cat

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

1 participant