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()

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

Methods

(async) connect()

Connect function - runs when controller connects to DOM

disconnect()

Cleanup when controller disconnects

initAutocomplete()

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

initialize()

Initialize the controller

(async) loadGoogleMapsPlaces()

Load Google Maps Places library