Considering I have a folder that contains multiple .gpx
tracks, my objective is to show each of them in a single leaflet map. Then I would personalize thing like tooltips of each track, the color for each track, etc.
I already searched and found these libraries:
https://github.com/mapbox/leaflet-omnivore
https://github.com/mpetazzoni/leaflet-gpx
But they only let me load one track. Is there a way to load an entire folder?
If leaflet does not allow it, is there another option?
EDIT:
So I have the tracks folder on my backend/server side, so to read them at the frontend I need some way to get the data.
My backend runs using Flask, and I got an endpoint to list all the files:
class GPS_Tracks(Resource):
def get(self):
files =[]
for f in os.listdir(files_directory):
if f.endswith(".gpx"):
files.append(f)
files.sort()
return files
It returns something like this:
[
"2016-01-15 17-43-20.gpx",
"2016-01-15 18-34-15.gpx",
"2016-01-16 21-36-19.gpx",
"2016-01-16 21-48-17.gpx",
"2016-01-16 22-58-56.gpx",
...]
So my frontend does a request to that endpoint and gets the names of the files. But I need to still access the files.
No comments:
Post a Comment