Member addresses can be important for BuddyPress and BuddyBoss sites.

You can provide separate profile fields for City, State, etc.  But that means increasing the number of profile fields.  And users prefer short forms.

Or you can provide a single field.  But then you’ll get a wide variety of input from your members.  For example, City may be entered as Los Angeles or LA or misspelled or etc.

This plugin uses a single field for a location.  And that field will use the Google Autocomplete feature.  As the user types, Google will provide several complete and verified addresses.

caption goes here
Autocomplete Example

The user’s selection will then be saved in a uniform manner as a single searchable string.  The string will include the postal code, if available.

Please Note: the user must click on one of the addresses provided by Google. If they just type in an address and then save, the address will not be verified and geo-coordinates will not be saved.

You can create multiple location fields and include them on the registration form.  They will also work if you edit Extended Profiles in wp-admin.

Creating a location field is done in the same manner as any other profile field:
wp-admin > Users > Profile Fields > Add New Field

caption goes here
Add a Location profile field

Search

This plugin supports searches, including distance, with:

GeoCode

When a member selects a verified address, Google also provides the latitude and longitude, or GeoCode, for that address.  The GeoCode can be used for many things, such as Maps and ‘Near By’ searches. Our BP Maps for Members plugin uses these GeoCodes to support radial searching of site members.

Any map solution will load much faster if Geocodes are already provided.  Every time you create a Location field, you will have the option of also creating a GeoCode.

cap goes here
GeoCode option when creating a profile field

This plugin does NOT include:

  • maps
  • an interface for creating maps

For Member Maps, please see:  BP Maps for Members

For Group Maps, please see:  BP Maps for Groups

 

BP xProfile Location requires WordPress 4.0 or higher and BuddyPress 2.0 or higher. It is compatible with the latest versions of WordPress and BuddyPress and the BuddyBoss Platform.

Note: If you are not using our BP Maps for Members or BP Maps for Groups, you will need to paste your Google key into the BuddyPress or BuddyBoss Platform settings.

If you use BuddyPress: Go to wp-admin > Settings > BuddyPress > Options. Under Profile Settings, find Google Maps API key, enter your key and Save.

Or if you use the BuddyBoss Platform: Go to wp-admin > BuddyBoss > Integrations > PhiloPress. Find Google Maps API key, enter your key and Save.

If you don’t have a free Google Maps API Keyhere is a tutorial on how to get one.

BP xProfile Location

 

24 thoughts on “BP xProfile Location

  • December 22, 2017

    Strange, for some reason I can not plug this plugin. There is an error:

    Google Maps - problem with Key

  • December 22, 2017

    Makway – Your screenshot indicates that your Google Maps API key is missing or malformed. Or there is a conflict due to the use of Google Maps by some other code on your website. Your browser’s javascript console will provide more info.

  • August 1, 2018

    Hi, this is not working for me. I provided the API key. Java Konsole says: This API project is not authorized to use this API. What can I do?

  • August 1, 2018

    Daniel – Your question is specific to the Google APIs, not our plugin.
    It sounds like you need make sure that all the required APIs have been enabled for your Google Key.
    Or you may need to adjust the authorized urls for your Google key.
    Perhaps you could remove url authorization until you are sure that you’ve created the other aspects of the key correctly.
    Google provides a lot of info about their error messages. For example:
    https://developers.google.com/maps/documentation/javascript/error-messages

  • February 24, 2019

    Hello

    I have your plugin on my site. You mention “near by” search. I don’t see this functionality in the BP profile search which I have, or a plugin that you have to allow that. How would it be implemented to search within a vicinity of let’s say 20 miles from New York or any other city someone enters?

    • February 25, 2019

      Update: Support for radial search is now included in the BP xProfile Location plugin, version 4.1 or higher.

  • March 25, 2019

    I am using XProfile + BP Profile Search.
    In one page I see the Console and this appears:
    Uncaught ReferenceError: google is not defined
    at pp_64_geo_initialize ((index):578)
    at (index):574

    • March 25, 2019

      The error means that your Google Maps API key is malformed.
      Or you did not follow the installation instructions about where to place your Google Maps API key for the BP xProfile Location plugin.

  • March 31, 2021

    I use BuddyBoss. On the search page… How do I set the default search distance to use “miles” instead of “km”?

    • March 31, 2021

      That value is set by BuddyBoss. You should ask them about it. Or you could try over-riding this template in your child-theme: buddyboss-platform\bp-templates\bp-nouveau\buddypress\common\search\profile-search.php. And then change the select order or just remove the option for km.

  • May 8, 2021

    Hi there
    i installed the plugin, follow the tutorial for API… and i ve got error return “Unable to charge Google Maps correctly on this page. This site is yours ?” I answer yes. I verified API and declaration of domain.. all is ok…
    So how can i fix that ?
    Thank you

    • May 8, 2021

      Google requires you to attach a credit or debit card. They allow a free quota that is enough for most sites. Please refer to the Google APIs documentation for more info.

  • August 17, 2021

    I’m getting an error “Google Maps JavaScript API error: ApiNotActivatedMapError”

    Any help is appreciated.

    • August 17, 2021

      That is an error from Google Maps. Google provides a link for more info re errors. From that page, for that error:
      The Maps JavaScript API is not activated on your API project. You may need to enable the Maps JavaScript API under APIs in the Google Cloud Console.

  • September 5, 2022

    I am transferring my site from another system and already have the GeoCode for each of my members. Is it possible to import this infomation and populate the location field so that distance searing will then work?

    • September 5, 2022

      Our plugin does not include an importer. You could write your own. Review the plugin code to see the approach for saving geocodes.

  • July 28, 2023

    I’m using buddyboss with xprofile to search by distance. Boss has a option to create multiple fields for each user but it can’t find the geocode using this method. Is there a way to do it when the user has more than 1 geolocation?

    • July 28, 2023

      You can only do a search by distance on one profile field.

  • September 24, 2023

    Does the plugin use cookies from google maps?

  • November 16, 2023

    Can the address details that a member enters only display town and zip code. To show their full address is a data privacy concern.

    • November 16, 2023

      Most sites want the full address. When you create a profile field of type ‘Location’ – you can add instructions to the user to enter only their city.

  • January 7, 2024

    Thanks for the great plugin!

    I hope you can help with this: On my BuddyBoss website, some users type the name of the city in the location field, without choosing the location from the dropdown. This way there will be no location data saved.

    I have set the location field as obligatory during the registration. Is there a way to empty the field if the user did not choose the location from the dropdown, sothat the user can not submit the registation form? Or do you have any other Ideas?

    • January 8, 2024

      There is no practical method of forcing them to make that selection. We suggest that the “Description” text of the profile field contain an instruction like: “Please make a selection from the dropdown or you will not appear on the Members Map”.

      You might be able to add custom javascript for the register page that checks if the hidden geocode field is populated with location data from Google. We cannot write that code for you.

Leave a Reply