Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jhurteaux

    (@jhurteaux)

    I tried to add indexes to the unique id that is generated twice but it does not seem to be enough:

    if (isNaN(window.mapIndex)) {
    		window.mapIndex = 0;
    		document.querySelectorAll('[id^="leaflet-map"]').forEach((element, index) =>  {
    		    element.classList.add("leafleft-map");
    		    element.id = element.id + "-" + index;
    		});
    	} else {
    		window.mapIndex = window.mapIndex + 1;
    	}
    
    	var map = L.map('leaflet-map-' + window.mapIndex, { dragging: !L.Browser.mobile, tap:!L.Browser.mobile });

    `

    Thread Starter jhurteaux

    (@jhurteaux)

    Ok, so I got it to work using a plugin for PHP code snippets.
    (from the 3 I tried, Post Snippets seems the best one with the option to enable parameters in a usable way)

    I think the extension usage would be greatly facilitated if this option was offered from the box, with the possibility to directly select one of the existing GPX files.

    • This reply was modified 2 years, 10 months ago by jhurteaux.
Viewing 2 replies - 1 through 2 (of 2 total)