Property Agent comes preloaded with Google Map functionality that allows you to geo-tag a property (e.g. assign it a lat/long) and then display on the property page.
Enable Google Maps
To enable Google Maps in property agent, go to Edit Layout Settings -> Map Settings.
From here, check "Enable Maps".
Note: you should no longer need to provide a Google Map key, but if you do, you can get one here.
The other settings relate to:
- Map width + height: the width and height of the [MAP] image used when viewing a property
- Map zoom: how far to zoom in on the [MAP] image used when viewing a property
- Distance expression: allows you to tune the searching algorithm when editing a property (see next section).
Once the maps are enabled, click update.
Tagging a Property with a Lat/Long
Now that you have enabled maps, when you edit or add a property, you should see a map with search by address option.
Searching by an address should present a location for that address. You can search by a well-known place or a street address. Once found, you can reposition the marker for further tuning.
This will also populate the latitude and longitude fields which marks our property with a specific location.
Viewing the [MAP] in a property
To view a map, your "Layout File" for view.item.html must have the [MAP] token specified. If it does, it will show an image as follows (using the zoom, width, height specified in settings).
Sorting by Distance
There is one last interesting feature concerning maps, sorting by distance.
In Edit Layout Settings, if you check "Search Location" in "Search Settings" and check "Distance" in "Sort Fields" of "Listing Settings". You will be able to search on properties and sort them on distance. To display the distance add [DISTANCE] in the listing.item.html layout file.
Note: the distance will only display when sorting on distance and the "location" is specified in the search criteria.