Proximity Search provides very flexible searching, this flexibility comes via XiUS architecture. Proximity Search provides searching of users according to the location.
Problem: If you want to search data according to the user's location. For example, you want to show users who belongs to Alaska (as State) and United States (as Country) or who is living around 1000 Miles area of United States.
Solution: To resolve above problem, We are here with the Proximity Search with XiUS. This Search uses Geocoding database to search location or it can calculate geocode via Google API. By this, You can create information on user's profile fields which shows user's address like City/State/Country/Zip Code. So that user can search information.
For example : You can
- Search according to user's City, State, Country and Zip code by using the Google API.
- Search according to user's Latitude and Longitude information by using Information.
How to Configure Proximity Search
There are currently two way to use Proximity Search.
- By Information
- By Google API
By Information
If you can create XiUS Information of user, then this is the easiest and best way to use Proximity Search. Follow below points to Configure
- First of all,make sure that Information of type Latitude and Longitude have been cerated if not then first create those. If you are using JomSocial 1.8.xx then you can create the required information through JSuser Information Type of XIUS. Create Information of Latitude and Longitude.
- Now Click for Proximity Search.
- Select the option By Information between the two given option.
- This page will show you all the parameters of the Proximity Search->By Information. Here, You have to set the plugin parameters as describe below:
- Select Information of Latitude and Longitude
- Latitude Information : Here, You have to give the Information name which you created for user's Latitude.(Created in Step-1)
- Longitude Information : Here, You have to give the Information name which you created for user's Longitude.(Created in Step-1)
- Default Location Configuration
- Set Default Location: It is used to show default location in google map when it opened or address is not found. You can set following options:
- None : Select it, If you don't want to set location.
- Google Map : Set the location in Google Map.
- Address : Set the location in Address Box.
- My Location : Set logged in user's location if available.
- Latitude of default location on Googel Map for Proximity Search : Here, We can set default Latitude of location which points location in Google Map.
- Longitude of default location on Googel Map for Proximity Search : Here, We can set default Longitude of location which points location in Google Map.
- Default Zoom level for Google Map : Here, You can set Google Map's zoom level.
- Other Parameters are same as other Information.
- Click on Save or Apply.
- Now Site members can search through Proximity Search by selecting the location from Google Map shown on Front-end.
By Google API
If you don't have user's Latitude and Longitude information of their location, then need not to worry about that. There is a solution available for you. You can create the Proximity Search Information "By using Google API". There are some requirements of using Proximity Search with By Google API option and these requirements are as :-
- You must have created the information of Country, State, City and Zip-code(optional). Information Country, State ad City are required for exact result of search.
- You must have generated Google Api Key (http://code.google.com/apis/maps/signup.html)
- Only 2500 Geo-codes of users' addresses can be requested from Google API. So this will take some time to give correct result of user search.
You can create Information of Proximity Search by following steps :-
- Create Informations of Country, State, City and Zip-code (Zip-code is optional).
- Now Create Information for Proximity Search.
- Select the option By Googlel API.
- This page will show you all the parameters of the Proximity Search->By Google API. Here, You have to set the plugin parameters as describe below:
- Google API Configuration
- Country Information : Here, You have to give the Information name which you created for user's Country.(Created in Step-1)
- Zipcode Information : Here, You have to give the Information name which you created for user's Zipcode. This is optional.(Created in Step-1)
- State Information : Here, You have to give the Information name which you created for user's State.(Created in Step-1)
- City Information : Here, You have to give the Information name which you created for user's City.(Created in Step-1)
- Default Location Configuration : Explained above in By Information section.
- Other Parameters are same as other Information.
- Click on Save or Apply.
- Now Site member can search through Proximity Search by selecting the location from Google Map shown on Front-end.
How to Search
Follow the following steps for searching users from an particular location:
- Click on the search menu. Search panel will be opened as shown in screenshot.
- Select either Google Map, Address Box or My Location.
- If Google Map is selected then "Show Google Map" link is shown, click on it and set the location in Google Map. Or if Address Box is selected then write the address of the location in the shown text box. Or if My Location is selected then Logged in User's location will be selected automatically.
- Add information by clicking on Search or by clicking on ADD shown at right side.
- Searched information will be shown at Searched Users Panel.
ScreenShots for Proximity Search By Information
ScreenShots for Proximity Search By Google API
Comments (0)