Tagged: buddypress location based search
- Vineeta Saxena on July 24, 2016 at 4:27 pm #4781
I want to create a location based search in buddypress for members by just putting location like “Alabama” in the menu and when clicked, the search should come out as members from Alabama only. Can anyone help?
Welcome to BuddyDev Forum. Please explain me bit more. Tell me what exactly you want.
1. Will it be a simple text based search to find the members under a particular location. If Yes it can be done easily.
2. Will it be a search based on location such as geo location to find out the member with in the certain range. If yes then it would be a strategical job and will take time.
Please let me know. What exactly your requirement is?.
- Vineeta Saxena on July 26, 2016 at 2:45 am #4787
Yes, I need to do both kinds of searc. Geo location based is also needed. How to do it?
- Brajesh Singh on July 27, 2016 at 4:01 pm #4801
In that case please think about this:-
1. How do you want to collect user location data?
2. Do you want to store the location as lat/lang pair or as spatial data type. MySQL dos have support for basic gis functionality/spatial data types, so you should create a new table and store user/point combination there. The Point is spatial data type and you will be storing WKT here.
3. If you have used the data type point, you may use spatial functions ST_DWithin/ST_Distance to accomplish your task.
If you are not comfortable with GIS data, you may store the user location as latitude/longitude pair. This tutorial (It is old when mysql had no support for spatial data types), by Google should help
All the best
You must be logged in to reply to this topic.