Custom Javascript Action on Marker Click

New home Forums Pro Add-on Custom Javascript Action on Marker Click

This topic contains 0 replies, has 1 voice, and was last updated by  Blackeye 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #52234

    Blackeye
    Member

    Hello,

    is it possible to have custom javascrit action on clicking the marker?
    More specifically, I want to send the title and description (or at least marker ID) to a form field next to the map.

    I’ve tried to add a simple javascript to the url (javascript:console.log(‘hello’);), but it worked only partly. By partly I mean, if I click on the marker, infobox appears and when I click on the link, the script is triggered. But I need this action to happen, when clicking directly on a marker, not on the link in the popup.

    I also tried to activate “Click marker opens link” in Advanced Settings, but this option caused:
    1. opening my “link” in a new window
    2. opening the popup in original window.

    My intention is just to execute the script, when the marker is clicked. No popup should be opened.

    Could you please help me to find a solution? I would expect it shouldn’t be difficult.

    Thanks in advance
    Petr

    #52246

    AbelC
    Moderator

    Hi There,

    Thank you so much for getting in touch with us, and our sincere apologies for the inconvenience.

    Could I kindly ask if you would be open to provide us with a link to your map page?

    We will then be able to take a closer look and provide you with the code needed to achieve this.

    Please do let me know, and we look forward to hearing back from you.

    Kind Regards,
    Abel

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

You must be logged in to reply to this topic.