Created on 07 July 2020
icon_unfollowing
Login to follow
google-places-autocomplete

Google Places Autocomplete

Stable version 1.0.0 (Compatible with OutSystems 11)
Uploaded on 07 July 2020 by 
google-places-autocomplete

Google Places Autocomplete

Documentation
1.0.0

Important Note: To use this component you must have an API key. To know more and get one please follow the steps provided by Google here.


Usage



After importing the GoogleAutocompleteWidget to your project drag the widget to the screen. The Autocomplete widget attaches to an input element of type text, and listens for text entry in that field. The list of predictions is presented as a drop-down list, and is updated as text is entered.

Internally the widget is an implementation of the Autocomplete class described here.


Inputs

The Autocomplete widget inputs allow to configure the widget behavior. You can directly fill them if they are static. If you want to adjust them dynamically, use variables, the widget will listen to the OnParametersChanged event and will readjust to the changes in the inputs.



  • InputId - The input widget where the text will be inserted.
  • Key - The API key is a unique identifier that is used to authenticate requests associated with your project for usage and billing purposes.
  • Options - The options input is mapped from the AutoCompleteOptions Class described hereto an equivalent struture in OustSystems.
    • ComponentRestrictions - Component restrictions are used to restrict predictions to only those within the parent component. For example, the country.
    • Types - The type of predictions to be returned by the Autocomplete widget. For a list of supported types, see the Types Static Entity which maps this list. If no type is specified, all types will be returned.
    • Fields - Fields to be included for the Place in the PlaceResult response. For a list of fields see PlaceResult structure. Nested fields can be specified with dot-paths (for example, "geometry.location").
    • Bounds - The area in which to search for places.
    • StrictBounds - A boolean value, indicating that the Autocomplete widget should only return those places that are inside the bounds of the Autocomplete widget at the time the query is sent. Setting strictBounds to false (which is the default) will make the results biased towards, but not restricted to, places contained within the bounds.
  • SelectOnEnter - When true, if the user presses enter after typing some text (no place is selected) the widget will automatically select the first prediction. If false, nothing happens, which is the default behaviour of the widget. This option was implemented to allow a common behaviour the original widget lacks. Note: This will not interfere with the selection of a place from the dropdown with the arrow keys and pressing enter afterwards.



Outputs

After configuring the widget inputs you need to define a handler action that will be triggered by the PlaceChanged event. The action will then receive a PlaceResult structure as an input with all requested / available fields for the selected place. The PlaceResult structure is mapped from a class with the same name described here.



Since the PlaceResult is a complex structure, this component also includes a helper client action called GetSimplifiedAddressComponents which extracts some common address attributes from the PlaceResult structure and outputs a SimplifiedAddressComponents structure, to assist you in getting some common tasks done quicker.




Support options
This asset is not supported by OutSystems. You may use the discussion forums to leave suggestions or obtain best-effort support from the community, including from  who created this asset.
Dependencies
Google Places Autocomplete has no dependencies.