Register   Login
     
  Categories  
  Archives  
  Authors  
  Blog  
27

A new demonstration of features in Property Agent has just been posted. The demonstration is called Team Locator and is designed to show the new distance sorting feature available in Property Agent.

Sorting by distance can be used in situations such as “Shop Locators” where the results are returned ordered upon the location of the user performing the search.

Generally speaking, to sort by distance we need to know two things:-

1.)    The origin of the person performing the search

2.)    The longitude/latitude of a property

If we know these two items, we can calculate the distance between the two points and sort by that value.

Note: for developers interested in how I implemented this in SQL Server, see this article.

The following steps describe how the Team Locator was setup:-

1.)    In layout settings, make sure maps are enabled and you have a valid google key (if you do not have a google key, you can get one here).

2.)    Specify a distance expression to retrieve the origin of the user performing the search. The expression will be made up of a [LOCATION] token which is retrieved from a new search textbox in the search modules (see further below). In the Team Locator, we are using Australian postcodes, so we are able to use [LOCATION], Australia as the expression. It’s important that the term the user is entering will result in a unique long/lat otherwise it will be difficult to sort on distance. For American zip codes, it might be [LOCATION], America. If you want to test out some geocoding searches, try this link.

3.)    Specify whether or not you want to search in miles or kilometres.

4.)    A new textbox called [LOCATION] is now available in the search areas of Property Agent (landing page and search companion module). You can turn on location in the various settings of each module, or use the [LOCATION] token if you have a custom search layout.

5.)    A new feature of the search companion module is to pick the sort order for search results. In the case of the team locator, the sort order is set to distance because we are only searching on location. This feature allows you to have different sort orders for the main module compared to the search companion module (as one might be a content search vs. a distance search).

6.)    Lastly, to see the distance in the module, you can use [HASDISTANCE][DISTANCE][/HASDISTANCE].

The template is also available for download in the templates area.

Comments

swebster
# swebster
Monday, December 08, 2008 10:09 AM
Scott - do you see adding a Google Map with search results plotted on it to a future release? Seems like the next logical step for this functionality.
Raymond Kirk
Friday, January 16, 2009 11:21 PM
I was just thinking about Sorting in Property Agent and you've really helped out. Thanks!
km to miles
Monday, June 01, 2009 11:51 AM
Scott - do you see adding a Google Map with search results plotted on it to a future release? Seems like the next logical step for this functionality.

Post Comment

Name (required)

Email (required)

Website

Enter the code shown above: