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

    (@hupe13)

    Please deactivate Litespeed or exclude the the js files from Leaflet Map and Extensions for Leaflet Map from caching.

    Thread Starter Killian Santos

    (@killiansantos)

    Hello @hupe13,

    Thank you for your help.

    I just deactivated LiteSpeed but it doesn’t seem to be better.

    Killian

    Plugin Contributor hupe13

    (@hupe13)

    Okay, try and error. ??
    Please put the the Javascript code in a html block after the [leaflet-marker] shortcode.

    Thread Starter Killian Santos

    (@killiansantos)

    No problem @hupe13 ??

    It is already the case, here is the JS present after the shortcode :

    <script>
    window.WPLeafletMapPlugin = window.WPLeafletMapPlugin || [];
    window.WPLeafletMapPlugin.push(function () {
    	var map = window.WPLeafletMapPlugin.getCurrentMap();
    	if ( WPLeafletMapPlugin.markers.length > 0 ) {
    		for (var i = 0; i < WPLeafletMapPlugin.markers.length; i++) {
    			var a = WPLeafletMapPlugin.markers[i];
    			a.on("click", function (e) {
    				if (typeof e.sourceTarget.getPopup() != "undefined") {
    					a.url = e.sourceTarget.getPopup().getContent();
    					window.location = (a.url);
    				}
    			});
    		}
    	}
    });
    </script>
    
    <script>
    window.WPLeafletMapPlugin = window.WPLeafletMapPlugin || [];
    window.WPLeafletMapPlugin.push(function () {
      var map = window.WPLeafletMapPlugin.getCurrentMap();
      L.control.locate({
        strings: {
          title: "Localizarme"
        }
      }).addTo(map);
    });
    </script>
    Plugin Contributor hupe13

    (@hupe13)

    Please put the the Javascript code in a html block after the [leaflet-marker] shortcode.

    I cant’t see that in the source of the page.

    • This reply was modified 2 years, 7 months ago by hupe13.
    • This reply was modified 2 years, 7 months ago by hupe13.
    Thread Starter Killian Santos

    (@killiansantos)

    You are right… I misread your message. Sorry ??

    I confused [leaflet-map] with [leaflet-marker].

    I just put the JS after all the [leaflet-marker] set and it works great!

    Thanks a lot for your help @hupe13 ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Turn map marker into url link’ is closed to new replies.