• Resolved nicotn

    (@nicotn)


    Hi !
    First, thanks for your plugins, it’s really great !

    I generate markers dynamically on Map with Custom Posts.

    
    $marker = '[leaflet-marker iconClass="fas fa-map-marker" lat="'.$lat.'" lng="'.$lng.'"]'.$content.'[/leaflet-marker]';
    
    print(do_shortcode($marker));
    

    My question : is there a way to attach custom data to marker as an ID ?
    I need to differenciate them in javascript for some content manipulations

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author bozdoz

    (@bozdoz)

    not sure; you can iterate all markers, in order, with WPLeafletMap.markers in JavaScript:

    WPLeafletMapPlugin.markers

    Gives you an array of marker objects.

    Thread Starter nicotn

    (@nicotn)

    Hi,
    Thanks for your answer.

    Finally i did my own solution with leafletjs. My needs are too complicated for this plugin. But i’ll keep it aside for others projects.

    Best regards,

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add custom data to marker’ is closed to new replies.