Closed Raruto closed 1 year ago
Fixes a regression introduced within v4.8.0 refactoring.
Related to https://github.com/Raruto/leaflet-elevation/issues/259
// <ele>0</ele> values shouldn't be interpreted as an empty ("false" or "undefined") value. toGeoJSON.gpx(new DOMParser().parseFromString( `<?xml version="1.0" encoding="UTF-8"?> <gpx version="1.0" xmlns="http://www.topografix.com/GPX/1/0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <trk> <trkseg> <trkpt lat="45.763340000" lon="12.843770000"> <ele>-1.000</ele> </trkpt> <trkpt lat="45.763240000" lon="12.847620000"> <ele>0</ele> </trkpt> </trkseg> </trk> </gpx>`, "text/xml"))
{ "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "_gpxType": "trk", "coordinateProperties": {} }, "geometry": { "type": "LineString", "coordinates": [ [ 12.84377, 45.76334, -1 ], [ 12.84762, 45.76324 ] ] } } ] }
{ "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "_gpxType": "trk" }, "geometry": { "type": "LineString", "coordinates": [ [ 12.84377, 45.76334, -1 ], [ 12.84762, 45.76324, 0 ] ] } } ] }
👋 Raruto
Fixes a regression introduced within v4.8.0 refactoring.
Related to https://github.com/Raruto/leaflet-elevation/issues/259
Troublesome example
@tmcw/togeojson (v6.5.0)
@tmcw/togeojson (v4.6.0)
👋 Raruto