Add user geolocation to your Vantage directory site!
Mobile device users do not need to know where they are! Their location will be automatically detected and used to populate the location search box. If they are on the move they can click the target icon at any time to update their location.
The plugin also saves desktop users from needing to manually enter their location and, as the plugin uses the same Google Geocoding service as Vantage, all dynamically generated locations will be recognised as valid addresses for location searches.
Updated: You can now choose any image to use as the ‘locate’ icon!
The User Locator plugin adds the following user geolocation functionality to Vantage:
- ‘Location’ field is added to the user – this can be edited on the Vantage edit profile page or from the WordPress user profile panel.
On each page load the following happens:
- If a user has specified their location in their profile it is used to populate the ‘Near’ search box.
- If the user is not logged in or has not set their location, then the users location (latitude and longitude coordinates) is grabbed using html5 geolocation.
- Their location is then reverse geocoded to attempt to get a human readable address. Update: you can now the select the component/format of the output address. Choose to display the the full address, town, postal code etc. If this is successful the address is displayed in the ‘Near’ box. If geocoding fails to get a human readable address the lat,lng coordinates are placed in the ‘Near’ box so the search results will still be relevant to their current location.
- If at any time the ‘Near’ box is already populated from a current search this is respected and nothing is changed.
- A small icon (choose any image to use as the icon!) is also inserted into the ‘Near’ search box. Clicking on this at any time will initiate geolocation and update the ‘Near’ box accordingly.