Google maps for BP profiles & site

0

Can a user select to add or hide a google map to their profile? Additionally, can there be like a site “mega map” that would display all of the pins from the profiles?

Here is what I am trying to do. I am trying to create a site where people can go to find local galleries, restaurants, etc., and I want each location who registers to the site to have their own profile. I then want the profiles to be indexed by search, have a map on them, and for a user to see all of the places that are near them.

Does that make sense?

  • Vaughan
    • Ex Staff

    Hi @katie,

    The googlemaps plugin has an addon which you can activate, which then creates a map on the users profiles linked to their address.

    But I don’t think it would be possible to create 1 big googlemap page with all those pins for each individual user itself. You would need to do a mashup which is a manual job, so you’d need to keep adding them manually. I don’t think there’s an automatic way of doing it. But I will certainly add this to the feature requests for the developer to look into.

    I will also ask 1 of our 2nd Level support guys @Hoang Ngo who might be able to work some magic to accomplish this somehow.

    Hope this helps

  • Hoang Ngo
    • The Green Incsub

    Hi @katie,

    I hope you are well today.

    The global map is an out of the box feature, i have made a basic add-on, which will create the shortcode to display all users in one map.

    Please extract the attachment, and copy the file to this folder

    wp-content/plugins/wpmu_dev_maps_plugin/lib/plugins

    And enable it in the admin add-on.

    Please give it a try and let us update :slight_smile:

    Best Regards,

    Hoang

  • Katie
    • WPMU DEV Initiate

    Hoang, I have had the modifications made successfully. Is there a way to modify the settings on the big map to be different than the settings on the user profile maps? Example is I’d like the size and scale (zoomed out) to be different. Thanks!!!

  • Hoang Ngo
    • The Green Incsub

    Hi @Katie,

    I hope you are well today.

    In the code I posted above, line 46, you will see a function name “global_map”, please replace whole function which the code below

    function global_map( $args ) {
    $users = get_users( array(
    'meta_key' => 'agm-bp-profile_maps-location',
    'meta_value' => null,
    'meta_compare' => '!=',
    'fields' => array( 'ID' )
    ) );

    $markers = array();
    foreach ( $users as $user ) {
    $markers[] = $this->member_to_marker( $user->ID );
    }

    //show up
    return $this->_create_map( $markers, false, $args );
    ?>
    <?php
    }

    And you can use some shortcode parameters like width, height, zoom etc.

    Example here

    [agm_global_map width="500px" height="300px" zoom="10"]

    If you have any issues please don’t hesitate to let us know so we can assist

    Best regards,

    Hoang

  • Philipp
    • The Bug Hunter

    A short update on this thread:

    to display a map with all BuddyPress members you can now do the following:

    1. Activate the AddOn “BuddyPress Profile Maps”

    2. This AddOn provides the shortcode [agm_all_profiles_map]

    Now you can use that shortcode anywhere to display a map with all members!