How to display marker information on front end – like in a loop?

New home Forums Visitor Generated Markers General queries How to display marker information on front end – like in a loop?

Tagged: ,

This topic contains 4 replies, has 2 voices, and was last updated by  gorg 3 weeks, 2 days ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #49768

    gorg
    Member

    Hi, I would like to Display some Information of all the markers the users submitted, like Image or title of the markers on a WordPress Page / front end.

    Can I set up a “new WP_Query” for that or how would I proceed?
    How do you store the Information given with the markers?

    Thanks for help.

    #49777

    Dylan
    Moderator

    Hi there,

    Thank you for getting in touch, we do appreciate your time.

    Yes, unfortunately, to create a custom loop you would need to query the database and create a loop as we do not make use of custom post types.

    You would need to query the following table ‘wp_wpgmza’, dependent on your database prefix.

    I hope this helps?

    Kind Regards,
    Dylan Auty

    #49812

    gorg
    Member

    Great, thanks for the fast response! I bought the plugin now and I can list all images submitted by users, this works fine.

    Is there a way to link these images to the Markers on the map and make them popup?

    Best Regards.

    #49815

    Dylan
    Moderator

    Hi there,

    Only a pleasure, happy to help wherever possible.

    Yes, this possible using a JavaScript event trigger. However, you would need to obtain both the relevant map ID and marker ID from the data previously pulled from the database table.

    Assuming you have this ready, you could simply fire this event whenever a visitor clicks on the image:
    var current_map_id = 5;
    var current_marker_id = 20;
    MYMAP[current_map_id ].map.getMarkerByID(current_marker_id ).trigger(‘select’);

    Where the `current_map_id` variable holds the map ID and the `current_marker_id` variable holds the marker ID.

    I hope this helps?

    Kind Regards,
    Dylan Auty

    #49836

    gorg
    Member

    Thanks a lot for your help! I set an onclick event on the pictures and added the ids with php. This works fine.

    #49848

    Dylan
    Moderator

    Hi there,

    Fantastic news, so glad to hear that helped.

    Please do let me know if you need anything else moving forward.

    Have a great day!

    Kind Regards,
    Dylan Auty

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.