The GeoLocatorFormHandler
is used to return items in a repository based on their geographical location and uses two handle methods:
HandleLocateItems
handles querying for items based on a provided input locationHandleCurrentResultPageNum
displays result pages. This method requires thathandleLocateItems
has been called to generate results to page through.
The StoreLocatorFormHandler
component is the configuration responsible for displaying geo-located stores or locations. Core Commerce also includes a geo-location droplet. Refer to the Guide to Setting Up a Store for information on this droplet. Use the form handler when user input is required, for example a customer providing a postal code. Use the droplet when user input can be inferred, such as when location information is available in the browser.
The GeoLocatorFormHandler
includes the following input properties. For additional information, refer to the ATG Platform API Reference.
Location Properties
Location properties provide a centralized location from which to search. Note that address
, postalCode
, city
and state
require a GeoLocatorProvider
that supports these methods:
Property Name | Type | Description |
---|---|---|
| String | Free-form address used to indicate a central location. A free-form address can be “Boston MA” or “1 Main Street” |
| String | When provided with |
| String | When provided with |
| String | Postal code used as a central a location. |
| Double | Used if no other method of geo-location is used. It sets the latitude to use as a central location. If another input method, such as |
| Double | Used if no other method of geo-location is used. It sets the longitude to use as a central location. If another input method, such as |
| String | If provided along with |
| String | If provided along with |
Site Filtering Properties
Site filtering properties are used when the items being located have a site membership property. By default, filtering occurs on the current site, but the search can be filtered to include specific sites.
Property Name | Type | Description |
---|---|---|
| Collection | IDs of sites by which to constrain the results. |
| String | Site scope by which to constrain the results. A site scope can be:
|
| Boolean | Runs the filter on all sites, including inactive sites. |
| Boolean | Runs the filter on all sites, including disabled sites. A disabled site is an inactive site. To include a disabled site, both the |
Distance Properties
Distance properties indicate the range of the returned results. Only items within the provided distance will be in the result set. Note that by default, distance is measured in meters.
Property Name | Type | Description |
---|---|---|
| Double | Items within this distance in meters are returned. |
| String | Identifies the unit of measure conversions used for distance. By default, this points to the |
| Double | The maximum allowed search distance, measured in meters. A value of -1 searches all items. |
Redirection Properties
Redirection properties are available to set URLs for conditional redirection. If a URL parameter is not available, redirection will not occur:
Property Name | Type | Description |
---|---|---|
| String | The URL that is used if no errors are encountered. |
| String | The URL that is used if errors occur. |
Results Properties
Results properties are available once the search has been run:
Property Name | Type | Description |
---|---|---|
| Collection | A collection of repository items that are found to be within a certain distance of a central location. These items are returned by the |
Page Navigation Properties
Page navigation properties allow you to create controls that navigate between pages of results. The following properties can be used to create navigation buttons on the results page:
Property Name | Type | Description |
---|---|---|
| Int | Maximum number of search results to display on a page. If the number of search results returned is greater than this, another page of results is displayed when the user clicks Next. The default is set to -1, which indicates there is no maximum. |
| Int | The number of results returned by the query. |
| Int | The ending index to display based on the current page. |
| Int | The starting index to display based on the current page. |
| Int | The current page of the results being displayed (1-based). The default is 1. |
| Int | The number of pages of results. |
| Int | The index of the first record of the result set that is displayed within the current page. |
| Int | The index of the last record of the results set that is displayed on the current page. |
The following properties determine the managers, services and types of items to use:
Property Name | Type | Description |
---|---|---|
|
| The |
|
| The |
|
| Identifies the |
|
| The |
| String | The repository item type to search for. Must be a valid item-descriptor for the repository used by the |