We need to replicate the Address module default field widget in a way that we have:
Wrapper with a distinctive class ".address-autocomplete-wrapper"
- The text field for Predictive address input with a distinctive class ".address-autocomplete-input", also set to be css hidden.
- All the regular address input fields based on the field settings (what fields were selected)
- - A generic class for all the fields ".initial-address-field"
- - A distinctive class for the fields for which their values can be taken form the google maps input:
- - - Country - ".country"
- - - Administrative area - ".state"
- - - Locality - ".city"
- - - Postal code - ".zip"
- - - Address (line 1) - ".street"
These values will be later interpreted with Javascript
We also need to retrieve the API key, from the module configuration and serve it to drupalSettings JS.
We also need to retrieve the allowed countries list and serve it to drupalSettings JS
We also need to render all the initial default address fields at the first load, as the address module does when there's only 1 single country allowed instead of waiting for the country selection after which the form is loaded through ajax.
Comments
Comment #2
Alluuu commentedComment #3
drugan commentedDone, except this:
https://cgit.drupalcode.org/address_autocomplete_gmaps/commit/
Comment #4
Alluuu commentedComment #5
Alluuu commented