Google Maps & BuddyPress & Gravity Forms

Hi There,

I have the following Challenge:
- We created a form with Gravity Forms to register new members for BuddyPress.
- If new members type in their address we would like to show their location with the help of Google Maps on their profile.

Here are my questions:
Is that possible with Google Maps Plugin?
How could that be achieved with Gravity Forms as described above? :slight_smile:

Thanks allot!

  • aecnu

    Greetings Tee,

    Thank you for the great questions.

    Is that possible with Google Maps Plugin?

    I do not know I have never tried to do it, but anything is possible when one is a competent coder with a vision and the will to get the job done - and I am not a coder.

    How could that be achieved with Gravity Forms as described above?

    This is custom coding which is beyond the scope of the support that we provide here but we do try to help if we can and would never withhold an answer if we indeed know one.

    With that said, I will see if I can get the lead developer in here with his invaluable insight into this plugin for his advice/advise for us about this entire idea.

    Though this may take a bit longer then a normal ticket, I will try to get him in here asap.

    Cheers, Joe

  • Vladislav


    This should be entirely possible - with more or less effort, depending on the specifics of your setup, of course. The profile maps for your user are automatically created from the address field you specify in the plugin settings. In the most straightforward scenario, Gravity Forms will write your users' addresses to an extended profile field. If your Gravity Forms integration writes to BuddyPress extended fields, you should be able to just select the address field in the add-on settings and be good to go.

  • Vladislav


    It's entirely possible to use more then one extended profile field for the address info, although it's less straightforward and involves setting up a define (which is also why I haven't mentioned it in my previous post, to keep it simple unless we have to go there). However, this shouldn't be too difficult either - let's try to work it out with an example. Suppose you have fields named "Country", "City" and "Street Address" in your extended profile fields, and would want to use this info in your user map generation. You would then set up a define like this in e.g. your wp-config.php:

    define('AGM_BP_PROFILE_MAP_USE_ADDRESS_FIELDS', 'Country,City,Street Address', true);

    Also, this info is exposed in a filter, so an advanced processing is possible as well, shall you need it.

  • Tee

    Hi There,

    I did the following so far:

    - Gravity Forms is creating and merging the extended profile fields 'City', ZIP', 'Street'
    - I installed the Google Maps plugin and activated the BuddyPress Profile maps Add-on
    - I added the following code to the theme's functions.php:
    define('AGM_BP_PROFILE_MAP_USE_ADDRESS_FIELDS', 'Ort,Postleitzahl,Strasse & Hausnummer', true);
    (This are the German equivalents. I assume that I have to use the visible names of the profile fields and no hidden codes)
    - I filled in all details in a profile (BTW: What happens if some information like the street name is missing?)

    Unfortunately I don't find the map? Do I have to add a short code somewhere?

    Thanks for your support!

  • Vladislav


    You shouldn't have to add an additional shortcode if you don't wish to - the map should be visible on your user's profile page (provided the "Show map in user profile" option is enabled). Frankly, I haven't tried to use the localized fields with this, but if you're not seeing a map for your user, it's likely that it didn't work quite right. There's an alternative way of providing the fields for the mapping, and that's via their IDs:

    define('AGM_BP_PROFILE_MAP_USE_ADDRESS_FIELDS', '12,3,8', true);

    ... where "12,3,8" are your field IDs in a comma-separated string.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.