GatheringLocationAutocompleteController

GatheringLocationAutocompleteController

GatheringLocationAutocompleteController

Provides Google Places Autocomplete for gathering location input fields using the classic google.maps.places.Autocomplete API.

Note: We use the classic API instead of PlaceAutocompleteElement because the new web component API doesn't expose selected place data programmatically. The classic API provides reliable place_changed events and getPlace() method.

Constructor

new GatheringLocationAutocompleteController()

Source:
Example
<input type="text" 
       data-controller="gathering-location-autocomplete"
       data-gathering-location-autocomplete-api-key-value="YOUR-KEY">

Methods

(async) connect()

Description:
  • Connect function - runs when controller connects to DOM

Source:

disconnect()

Description:
  • Cleanup when controller disconnects

Source:

initAutocomplete()

Description:
  • Initialize Google Places Autocomplete using the classic Autocomplete class (PlaceAutocompleteElement doesn't expose data programmatically, so we use the old API)

Source:

initialize()

Description:
  • Initialize the controller

Source:

(async) loadGoogleMapsPlaces()

Description:
  • Load Google Maps Places library

Source: