Support » Plugin: Extensions for Leaflet Map » Showing GPX with elevation doesn’t work

  • Resolved gh2k

    (@gh2k)


    I was finally able to show a GPX file using leaflet-gpx after I configured a rewrite rule RewriteRule .*\.gpx$ – [L,T=application/gpx+xml] as per a previous forum post. However, when changing the leaftlet-gpx src= to elevation gpx=, I’m not getting a GPX file loaded, but a DataCloneError: The object could not be cloned. in the console.

    The other thing I noticed is that unlike wp-gpxmaps, using the leaflet plugin, the GPX file is always sent to the client browser, so it’s super easy to fetch a copy even without a download link being present.

    My last question is whether there will be a management interface on the roadmap to upload files, like it is offered by wp-gpxmaps, and/or a shortcode conversation routine to perform a bulk migration from one plugin to another?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author hupe13

    (@hupe13)

    However, when changing the leaftlet-gpx src= to elevation gpx=, I’m not getting a GPX file loaded, but a DataCloneError: The object could not be cloned. in the console.

    Can I get a link to your webpage? Or a link to the gpx file?
    Which shortcode you are using?

    The other thing I noticed is that unlike wp-gpxmaps, using the leaflet plugin, the GPX file is always sent to the client browser, so it’s super easy to fetch a copy even without a download link being present.

    Well somehow the browser will always get the data and if the visitor has the necessary knowledge, he will always get the data.

    My last question is whether there will be a management interface on the roadmap to upload files, like it is offered by wp-gpxmaps, and/or a shortcode conversation routine to perform a bulk migration from one plugin to another?

    I’m sorry, that is beyond my knowledge and skills.
    What I might realize would be the interpretation of the shortcode wp-gpx-maps and some of its parameters. (mapping)

    • This reply was modified 3 months, 1 week ago by hupe13.
    Thread Starter gh2k

    (@gh2k)

    Thanks for the quick reply. Here are the shortcodes that have been used so far:
    [sgpx gpx=”/wp-content/uploads/gpx/2021-08-29-1155 Stollenwanderweg.gpx”] (wp-gpx format)
    [leaflet-map] [leaflet-gpx src=”/wp-content/uploads/gpx/2021-08-29-1155 Stollenwanderweg.gpx”] (leaflet without elevation information, fitbounds is configured as a default)
    [leaflet-map] [elevation gpx=”/wp-content/uploads/gpx/2021-08-29-1155 Stollenwanderweg.gpx”] (leaflet with elevation information – this is the one that isn’t rendering).

    test location: https://hannes.gfrerer.name/2020/12/test/

    The datacloneerror doesn’t seem to be related to the map integration. In a different browser (Edge Chromium), I noticed the following error though: Error: <polygon> attribute points: Unexpected end of attribute. Expected number, “… 341.459,306.011”.

    I understand that an experienced user would always be able to fetch the track, but the way leaflet works makes it really super easy, so ideally a similar pattern as wp-gpx maps should be considered in the future. The upload interface would also be a really helpful feature for the community.

    Thanks a lot!

    Plugin Author hupe13

    (@hupe13)

    For extensions-leaflet-map you need also leaflet-map, this I’m missing, see here. wp-gpx-maps and leaflet-map don’t work together. If you can’t deactivate wp-gpx-map, I posted a solution. Please try this.
    Which plugin is on the path wp-content/plugins/leaflet/?

    Thread Starter gh2k

    (@gh2k)

    leaflet-map is installed, and was proven to work (using the leaflet-gpx shortcode). wp-gpx maps and leaflet-maps do not need to run on the same page, I just included the shortcodes for reference. plugins/leaflet is not an actual plugin, but just a local deployment of the leaflet scripts (to avoid the CDN reference)

    Plugin Author hupe13

    (@hupe13)

    The js (and css) files for wp-gpx-maps are loaded on every page, regardless of whether they are used or not. Thats why leaflet-map doesn’t work. The code I posted dequeues these files when the shortcode sgpx does not exist.
    Please deactivate wp-gpx-maps or write this code in your functions.php.

    Thread Starter gh2k

    (@gh2k)

    Thanks – I tried deactivating wp-gpx-maps completely temporarily but still the map with elevation is not loading so there must be another issue.

    Plugin Author hupe13

    (@hupe13)

    The Developer Console of Firefox and Chrome shows some CSP-Warnungs. You should check these (independent of your problem).
    Your gpx file works in my testing environment. 😉
    Please deactivate wp-gpx-maps again, clear the browser cache, reload your page and check in the Developer Tools, if really the files of wp-gpx-maps are not loaded.

    Plugin Author hupe13

    (@hupe13)

    Okay, I will try to include in the plugin the above script and the mapping of some parameters from sgpx to elevation.

    Plugin Author hupe13

    (@hupe13)

    How is your knowledge to test a first version of https://github.com/hupe13/extensions-leaflet-map?
    The shortcode is like the original, but only the parameter gpx is valid, all others are ignored.

    https://your-domain.tld/wp-admin/admin.php?page=extensions-leaflet-map&tab=elevation
    Set the parameter sgpx (at the bottom of the page) to true.
    wp-gpx-maps can be active.

    Thread Starter gh2k

    (@gh2k)

    I tried a number of things with the official 2.1.3 release but still wasn’t able to render anything with the elevation or elevation-track shortcodes (even with wp-gpx maps and other plugins being completely deactivated, and a different theme applied), so I haven’t spend time on testing the new release. The CSP warnings are coming from the contact form solution which I’ll be replacing soon. If you have specific items you want me to test, send me a note through the contact form on the site.
    Thanks!

    Plugin Author hupe13

    (@hupe13)

    @gh2k and for all who read along here: The mentioned script worked at that time, with the current version of wp-gpx-maps it does not work anymore.

    • This reply was modified 3 months ago by hupe13.
Viewing 11 replies - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.