Google Map Plugin Buddypress Group

I'm trying to add a google street view based on a groups location to the groups cover and add a normal gmap to the group profile picture.

Currently, I'm using advanced custom fields and the way I have it set up I have to enter the embed code on the back end and its a pain in the butt, I'm sure there's a way to do it on the front end.

I came across this plugin and I'm trying to figure out how to call it so I can place in the group-head.php and the map will change based on the group selected. I cant figure out how to get it to dynamically changed based on the group.

Basically, in the map tab on groups I need that map to display in the cover.

  • Rupok
    • Support Ninja

    Hi Booker,

    Thanks for asking. When you have BuddyPress Groups and our Google Maps plugin enabled and activated, then while creating a group, you will get a field for the group location. Even, when you have already created a group, you can edit that group and add an address for that group. Then you can simply use the following shortcode to show group location map:
    [agm_group_map group_id="1"]
    Please replace "1" with your actual group ID.

    So for dynamically showing group map, you can dynamically get the group ID and use do_shortcode() function for showing the map on your desired location in your group. To know more about the do_shortcode() function, you can check this guide: https://developer.wordpress.org/reference/functions/do_shortcode/

    Please note, you will need to enable "BuddyPress group maps" addon by going to "Dashboard > Settings > Google Maps > Add-ons" section for having this group map feature.

    I believe this will help. Please let us know if you have any confusion or any further query. We will be glad to help.

    Have a nice day. Cheers!
    Rupok

  • Booker
    • Flash Drive

    Hey thanks for the reply! So I got the do_shortcode working but now im trying to make it dynamic.

    I've been playing around with this for about 4 hours. I have no idea the correct way to pull the group ID value correctly. Below is what I've come up with thus far. I appreciate the help.

    echo do_shortcode("[agm_group_map group_id=\"$bp_get_group_id\"]")

  • Rupok
    • Support Ninja

    Hi Booker,

    Instead of the code you are using, can you please try the following?
    <?php echo do_shortcode( '[agm_group_map group_id="'.bp_get_group_id().'"]' ); ?>
    It's working on my test site BuddyPress group page. So it should work on your site too.

    Please let us know if this doesn't help. We will be glad to assist further.

    Have a nice day. Cheers!
    Rupok

  • Rupok
    • Support Ninja

    Hi Booker,

    I'm afraid, you can't set street view from shortcodes, but you can set this from the Google Maps options page. To set this, please go to "Dashboard > Settings > Google Maps > Options" page and set "Default map type" to "ROADMAP".

    And while adding a map in a post, you can checkmark the "Show Panoramio overlay" option to get the panoramic photos of the area. Please check the attached screenshot for reference.

    You will get the full usage guide of this plugin here: https://premium.wpmudev.org/project/wordpress-google-maps-plugin/#product-usage

    Please let us know if this is not what you are looking for. We will be glad to help further.

    Have a nice day. Cheers!
    Rupok

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.