Option Overview
- Options are used to customize or tailor our Global Address Complete to your specific needs. In the code it is the second parameter to the Address control object when setting up the integration.
Address Control Object
var DOTSGlobalAddressComplete= new so.Address(fields, options);
- Options allow for some customization of the results that are returned. For example, setting setBiasToIP to true will bias the returned results to the users location as determined by their IP address
Options*
var options = { key: CustomKey, setBiasToIP: true };
- *In some newer Javascript frameworks, the “options” field will need be explicitly named options and created as a global variable i.e. “window.options = { key: CustomKey, setBiasToIP: true };”
Option Table
Option | Default | Values | Description |
---|---|---|---|
key | No default | String | The Custom Key. |
isTrial | true | true, false | Determines if executing Global Address Complete against our trial or live environment. |
setBiasToIP | false | true, false | Sets the starting location from which results should be return from to the IP location of the user so that if you are in Santa Barbara, CA, USA as you type suggested addresses returned are first from there. |
setCountryByIP | false | true, false | Sets the country selected to the country of the user. |
countries | No default | Various country values | Limits the suggestions to by country, for example this can be added to the options to restrict suggestions to Canada, Russia and Sweden: countries: { codesList:”CAN, RUS, SWE”} |
Validate | true | true, false | Sets the selected United States addresses to return validated against our DOTS Address Validation US – 3 Service. |
Accessibility | false | true, false | Setting to true will turn on ID’s for screen readers and high contrast for visually impaired. |
languagePreference | en | Various | Two letter ISO codes for the language preferred. |
prompt | false | true, false | Turn on additional prompts based on conditions of the suggestions, such as: “No Results Found” or “Keep Typing…” |
maxItems | 7 | Integer | The maximum number of items to return in the dropdown. |
DoPlace | false | true, false | Setting this option to “true” will set the component to do place predict suggestions instead of address. |
SearchType | Locality | Locality only but will vary in the future | Determines the Global Address Complete Search Type if specified. If using the Address Search Type, no need to include this field. If a value is placed that does not match with Locality, it will return empty results. More Search Type options coming soon. |
*Note, the true/false values are boolean values and not strings.