Page 1 of 2
New plugin "GPX Viewer": Displays GPS tracks on map
Posted: Sun Nov 01, 2020 11:32 am
by Arvid
Hi,
I'm happy to introduce to you my latest FlatPress plugin:
GPX Viewer!
It makes use of Jürgen Berkemeier's free JavaScript library GPX Viewer to display uploaded GPS-recorded tracks and routes (GPX format) on a OpenStreetMap map with a corresponding height profile.
It adds a BBCode tag “gpx” to include your uploaded GPX file into your blog entry or static page. It's really just as simple as that:
See the plugin in action on my personal bike touring blog:
https://fahrrad.arvidzimmermann.de/2020 ... -mrkische/
Download and documentation on the wiki
Please let me know if you encounter any bugs or glitches.
All the best,
Arvid
Re: New plugin "GPX Viewer": Displays GPS tracks on map
Posted: Sun Nov 01, 2020 2:14 pm
by dsteuer
Congratulation! Cool plugin!
Detlef
Re: New plugin "GPX Viewer": Displays GPS tracks on map
Posted: Mon Nov 02, 2020 9:22 am
by miksmith
Brilliant job! This is great to have
Ive uploaded a
test tracklog and the track seems to be offset. Having tried this on a couple of route planning sites, they seem to be correct. Is this ia bug in the underlying library?
cheers
mike
Re: New plugin "GPX Viewer": Displays GPS tracks on map
Posted: Mon Nov 02, 2020 10:11 am
by dsteuer
miksmith wrote: ↑Mon Nov 02, 2020 9:22 am
Brilliant job! This is great to have
Ive uploaded a
test tracklog and the track seems to be offset. Having tried this on a couple of route planning sites, they seem to be correct. Is this ia bug in the underlying library?
cheers
mike
You could try it out here:
https://www.j-berkemeier.de/ShowGPX.html That's the main page of the lib devel.
Detlef
Re: New plugin "GPX Viewer": Displays GPS tracks on map
Posted: Mon Nov 02, 2020 11:22 am
by miksmith
Ah, good idea! Yes, that works fine. Does that mean its likely a problem with the plugin?
Re: New plugin "GPX Viewer": Displays GPS tracks on map
Posted: Wed Nov 11, 2020 11:23 am
by Arvid
Hi,
thanks for reporting. The FlatPress template around may set a margin to images which causes the offset.
Please add the follwoing to your
fp-plugins/gpx/res/gpxplugin.css:
Code: Select all
div.leaflet-pane img {
/* image margins given by the FP template have to be reset in order to avoid track offset */
margin: 0px !important;
}
This should remove the offset, does it?
I will add this to the plugin package.
All the best,
Arvid
Re: New plugin "GPX Viewer": Displays GPS tracks on map
Posted: Wed Nov 11, 2020 2:14 pm
by miksmith
Yes, that fix works
Re: New plugin "GPX Viewer": Displays GPS tracks on map
Posted: Fri Nov 13, 2020 5:31 pm
by miksmith
Is there a way to change the default basemap?
Re: New plugin "GPX Viewer": Displays GPS tracks on map
Posted: Sun Dec 27, 2020 11:25 am
by Arvid
In fact, there is.
The map DIV has the CSS class "gpxview:PATH_TO_GPX_FILE". Just append the type of map with a ":" to this.
For example, change line 50 of
gpxplugin.class.php from
$mapDiv = '<div id="' . $divId . '" class="gpxmap gpxview:' . $filePathRel . '"><noscript><p>' . $noJsError . '</p></noscript></div>';
to
$mapDiv = '<div id="' . $divId . '" class="gpxmap gpxview:' . $filePathRel . ':OPENTOPO"><noscript><p>' . $noJsError . '</p></noscript></div>';
to set the default map to OpenTopo.
For the different map names, see the
GPX Viewer documentation (
English translation by Google).
All the best,
Arvid
Re: New plugin "GPX Viewer": Displays GPS tracks on map
Posted: Sun Dec 27, 2020 4:34 pm
by miksmith
Brilliant! The OpenTopo was the one I wanted and looks really good. THanks!!!