Waymark icon indicating copy to clipboard operation
Waymark copied to clipboard

download separate from map

Open Johanmtb782 opened this issue 1 month ago • 5 comments

Dear Sir/Madam, I'd like to have the export and download options in the Waymark plugin separate from the map, and placed below or next to it on the page. Is there a separate shortcode for this?

Johanmtb782 avatar Nov 20 '25 13:11 Johanmtb782

Thanks for reaching out. Please see this example of how to do this using the callback function.

I hope this helps.

morehawes avatar Nov 20 '25 13:11 morehawes

Is niet gelukt Kunt u mij een voorbeeld geven?

Didn't work out Can you give me an example? https://johanmtb.com/proef-gpx/

[Waymark map_id="1801"]

hopelijk voldoende?

Johanmtb782 avatar Nov 20 '25 13:11 Johanmtb782

I use the cloning the Export Feature function but get multiple exports under each map when I put multiple maps on one page. If I put two cards, then two by three, then three.

Johanmtb782 avatar Nov 22 '25 10:11 Johanmtb782

Hi @Johanmtb782,

Try this instead, only include the script once on the page:

// Once the page has loaded
jQuery(document).ready(function () {
  //Get the shortcodes
  const shortcodes = jQuery(".waymark-shortcode");

  // Each shortcode
  shortcodes.each(function () {
    const shortcode = jQuery(this);
    const exportContainer = jQuery(".waymark-meta-export_data", shortcode);

    //Add after the Map
    shortcode.after(exportContainer.clone());
  });
});

I hope this helps.

Joe

morehawes avatar Nov 22 '25 14:11 morehawes

Sorry another download of the first map, the other maps give the route of the first map.

Johanmtb782 avatar Nov 22 '25 15:11 Johanmtb782

Hi Joe

This works very well if there is a map on a page. But if there are multiple maps on the page, the next Map indicates the gpx Of the first map, with even more maps, only the first map is downloaded.

GR JOHAN

morehawes left a comment (OpenGIS/Waymark#68) https://github.com/OpenGIS/Waymark/issues/68#issuecomment-3566763372 Hi @Johanmtb782 https://github.com/Johanmtb782,

Try this instead, only include the script once on the page:

// Once the page has loaded jQuery(document).ready(function () { //Get the shortcodes const shortcodes = jQuery(".waymark-shortcode");

// Each shortcode shortcodes.each(function () { const shortcode = jQuery(this); const exportContainer = jQuery(".waymark-meta-export_data", shortcode);

//Add after the Map
shortcode.after(exportContainer.clone());

}); }); I hope this helps.

Joe

— Reply to this email directly, view it on GitHub https://github.com/OpenGIS/Waymark/issues/68#issuecomment-3566763372, or unsubscribe https://github.com/notifications/unsubscribe-auth/BOGSOM3F427ABM5AGMFDLKT36BYINAVCNFSM6AAAAACMWGX3JCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKNRWG43DGMZXGI. You are receiving this because you were mentioned.

Johanmtb782 avatar Nov 24 '25 07:11 Johanmtb782

What I've done now is split the page, and it works. But it is not the solution.

Johanmtb782 avatar Nov 24 '25 20:11 Johanmtb782