• Resolved acmdesigns

    (@acmdesigns)


    I have multiple markers added. Is it possible to display the map with all markers visible? I tried manually positioning the map from the admin page, but it doesn’t save the position I set properly.

    Also, is it possible to link to a marker via javascript? For example, click a link and have it center on a specific marker. Similar to the listing feature in the pro version, but with a custom list.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi there

    Thank you for getting in touch with us.

    Unfortunately the plugin doesn’t have the functionality to dynamically position the map based on the markers on it at this point in time. My apologies for any inconvenience caused by this.

    You’d be able to open and center a marker via JavaScript by using the function openInfoWindow( marker_id, map_id, false)

    You’d be able to add this as a click event to each of your links as shown in the example below:

    <a onclick='openInfoWindow( marker_id, map_id, false)'>My Marker</a>

    I hope this helps?

    Thread Starter acmdesigns

    (@acmdesigns)

    Thanks for the info Jarryd.

    The openInfoWindow method doesn’t exist. Are you sure it’s correct?

    Hi @acmdesigns

    My apologies for the confusion caused. Unfortunately this function is only available in the Pro version of the plugin.

    Please go to wp-google-maps/js/wpgmaps.js and add in the following simplified function and let me know if this helps?

    function wpgmza_open_marker_func( map_id, marker, html ) {
        infoWindow[marker].setOptions({maxWidth:'250px'});
        infoWindow[marker].setContent(html);
        infoWindow[marker].open(MYMAP[map_id].map, marker);
    }
    Thread Starter acmdesigns

    (@acmdesigns)

    FYI, the code you provided didn’t quite work by itself. I needed to do some extra leg work to get it to work. I had to create the marker which added a duplicate marker to the map and looked funny and some other things that seemed like patch work on the existing map.

    I ended up purchasing the pro version as it allowed me to use the built-in openInfoWindow method and had some other features that I liked as well. Thanks for the help.

    Hi there

    My apologies for the inconvenience caused by the code not working straight off the bat.

    Thank you so much for purchasing our plugin though. I hope you enjoy it ?? Just shout if there’s anything we can assist you with.

    For Pro version support, you can get in touch with us on https://www.wpgmaps.com/contact-us.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘center map on all markers’ is closed to new replies.