leaflet-gpx icon indicating copy to clipboard operation
leaflet-gpx copied to clipboard

XML String ?

Open OliEmi opened this issue 6 months ago • 1 comments

Hello, I try to include the GPX datas directly in a XML string as suggested in the comment "// URL to your GPX file or the GPX itself as a XML string." (I work only in local and don't want to create a local webserver). It doesn't work, I have an error like : "gpx.min.js:1 Uncaught TypeError: Cannot read properties of undefined (reading 'max_point_interval')"

I guess that my "XML string" is not correct. Do you have an example of such "XML string" ? Or this possibility (XML string) doesn't work ?

Thank you very much for your help

OliEmi avatar Jun 09 '25 20:06 OliEmi

You should be able to pass in the GPX XML data directly indeed; see https://github.com/mpetazzoni/leaflet-gpx/blob/main/gpx.js#L355-L364 for the corresponding logic.

Does your XML string start with < as expected?

mpetazzoni avatar Jun 12 '25 21:06 mpetazzoni