• Hello,

    i use the following shortcode as a test to show one of my GPX tracks.

    [leaflet-map fitbounds]
    [leaflet-gpx src=https://overide.eu/blog/test.gpx color=red]

    but the track is not displayed on the map.
    could there be a problem with the gpx file? it is not a recorded but planned track.

    Thank you

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Contributor hupe13

    (@hupe13)

    Try the absolute or relative path to the gpx-file, e.g.

    [leaflet-map fitbounds]
    [leaflet-gpx src="/blog/test.gpx" color="red"]
    Thread Starter overide6

    (@overide6)

    Thank you, but I tried all the possibilities, and nothing worked.
    Here’s a link to the GPX-File I want to display

    Plugin Contributor hupe13

    (@hupe13)

    Try
    [leaflet-gpx src="/blog/wp-content/uploads/gpx/test.gpx" color="red"]

    Thread Starter overide6

    (@overide6)

    nope, doesn’t work.
    maybe there is someting with the gpx-file?
    I added your lines (inserted the real gpx-file) to my last post, so you can see how it looks like, map on top of the post.
    LINK

    Plugin Contributor hupe13

    (@hupe13)

    It works perfect. But you are using the wp-gpx-map plugin also.
    Both together do not work on the same page.

    Thread Starter overide6

    (@overide6)

    ok – but even if I deactivate the wp-gpx-map plugin I can’t get it to work.
    what the hell I’m missing?!

    this is the shortcode I inserted in the classic block from Gutenberg

    [leaflet-map fitbounds]
    
    [leaflet-gpx src="/wp-content/uploads/gpx/2020-01-03_Zirbitzkogel.gpx" color="red"]

    Sry if I’m missing something

    Plugin Author bozdoz

    (@bozdoz)

    Quite often it’s an issue with how WordPress deals with gpx files (it doesn’t have a mimetype for it). Check out this issue here:

    https://github.com/bozdoz/wp-plugin-leaflet-map/issues/81

    Solution was at the time, to add this to your functions.php:

    add_filter( ‘upload_mimes’, ‘my_myme_types’, 1, 1 );

    function my_myme_types( $mime_types ) {
    $mime_types[‘gpx’] = ‘application/gpx+xml’;
    return $mime_types;
    }

    However, I think last time this came up, this did not work. There should be another issue related to this on this support forum. I will check.

    Plugin Contributor hupe13

    (@hupe13)

    Thank you, Bozdoz, for the tip with mime types. I have some files ending with .ms.gpx. These I could not open with your plugin. Now it works, I have in .htaccess:

    RewriteRule .*\.ms\.gpx$ - [L,T=application/gpx+xml]

    But this was not a really problem for me, because I used the kml files.

    Thread Starter overide6

    (@overide6)

    add_filter( ‘upload_mimes’, ‘my_myme_types’, 1, 1 );

    function my_myme_types( $mime_types ) {
    $mime_types[‘gpx’] = ‘application/gpx+xml’;
    return $mime_types;
    }

    Thank you, but this doesn’t work.
    I would really like to test you plugin and maybe replace the wp-gpx-map plugin with it, but as it doesn’t go easy I’ll stick to the wp-gpx-map plugin and will try your plugin later again.
    Thanx for your help and great work with the plugin, as it is highly adaptable!

    Plugin Contributor hupe13

    (@hupe13)

    Your website is running Apache, so write in your .htaccess:
    RewriteRule .*\.gpx$ - [L,T=application/gpx+xml]

    The function my_myme_types doesn’t work for me too.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Selfhosted gpx doesn’t show’ is closed to new replies.