• Resolved zeeleny

    (@zeeleny)


    Hello there,

    Id like to create either a leaflet that pushes the map to the side on the marker click, showing the inside content, or to create a more elaborate popup than the one we already can. For the record, Im trying to duplicate somewhat AirBnB style. I tried the developers option, which unfortunately is limited to 50 characters at any given time in the box. Should I have custom CSS class defined in a different file? How about JS function then, as I dont see any file storing Heromaps information anywhere.

    Thanks alot,
    Martin

    https://www.ads-software.com/plugins/hero-maps-pro/

Viewing 1 replies (of 1 total)
  • Hi Martin

    I’ve forwarded your question to our devs, and they responded with the following:

    From the developers option tab, when the ‘Marker “onclick” Event’ is enabled, you are able to define a javascript method name within the input provided labeled ‘Javascript Method’. This method however should not be coded within this input field, only defined.

    You can then from a separate JS file use this method name and create the functionality needed to run when a marker is clicked. Each marker will now have an additional input for a custom parameter which will be passed to the new method when the marker is clicked. On the ‘Developers’ tab you can also assign a custom CSS class to the map container if needed in order to target markers only within this map if there are multiple maps on the page.

    Just as a quick example, if use marker_click within the ‘Javascript Method’ input I can then add the following to a JS file included on the page where the map is.

    //show location marker data
    function marker_click(marker_data){

    //log location marker data to the console
    console.log(marker_data);

    //example output – the custom parameter is added on each markers edit options
    {“marker_id”: 123, “location_title”: “my location marker”, “custom_param”: “my location”}

    }

    If this isn’t clear enough, I’ll get them to provide a more detailed answer for you ??

    Regards
    Jaydon

Viewing 1 replies (of 1 total)
  • The topic ‘Map marker Action’ is closed to new replies.