mpetazzoni / leaflet-gpx

A GPX track plugin for Leaflet.js
http://mpetazzoni.github.io/leaflet-gpx
BSD 2-Clause "Simplified" License
529 stars 114 forks source link

GPX Style extension should also be parsed from the <trk> element #86

Closed mhaberler closed 4 years ago

mhaberler commented 4 years ago

I am fairly sure the placement of the color option parsing code is at the wrong tag: https://github.com/mpetazzoni/leaflet-gpx#line-styling

unfortunately https://www.topografix.com/GPX/gpx_style/0/2 mandates no clear place where to put this

I arrived at this by analogy - have a look at some of the GPX files on github, eg

https://github.com/mapbox/togeojson/blob/72957d69545ed1f798d56618694473b603a0ba6f/test/data/style.gpx https://github.com/hsnetzer/gpx-pinhoti/blob/76bdf95095ec0f42521a3c94dac29ceb7824aa3b/B.gpx

or search for https://github.com/search?q=www.topografix.com%2FGPX%2Fgpx_style%2F0%2F2+line+color+trk&type=Code for more examples

mpetazzoni commented 4 years ago

This should now work as expected with the latest from master.