Plugin Author
hupe13
(@hupe13)
This should not be so easy, if not impossible. You would first have to read the gpx files, calculate the length of the track and then filter it. (I’m happy to be corrected).
In my opinion, a better would be the approach here. You have a database and filter from there.
I have done something similar on my private website with a mysql database. There are entries of the tracks including their length. But this database already existed before I used WordPress.
Thank you, I did indeed try it with building up the code with leaflet shortcodes. I now stored the lengths of the map and some more properties in a database and can easily get the correct information from it.
I have a working ajax call function which generates the map (without any content) I want. The return of the function is for testing purposes two statements which contain a shortcode to control the leaflet plugin.
The weird thing is that it does generate a map via the shortcode of [leaflet-map] with the ajax call however, it does not generate a gpx route within that map with [leaflet-gpx src=”source.gpx”].
Perhaps there is a much easier way to update the gpx routes on the map?
Plugin Author
hupe13
(@hupe13)
The weird thing is that it does generate a map via the shortcode of [leaflet-map] with the ajax call however, it does not generate a gpx route within that map with [leaflet-gpx src=”source.gpx”].
gpx (geojson) files load asynchron, they are ready with loading after the map is ready. You need to reload the map.
Perhaps there is a much easier way to update the gpx routes on the map?
I have no idea.