By default, the Address field will auto-complete the associated address fields based on their field names. The Place field will automatically fill fields named address_line_2, city, state, postal_code. However, you may customize the field names that should be auto-completed using the following methods:
Demo: https://youtu.be/RdK0jyGWl98
Component Usage:
Insert the script file to the page:
<script src="{{ asset('js/address.js') }}" async defer type="text/javascript"></script>
Setup the Google API key:
Then we can do something like this:
Get all predictions from Google API.
Show/hide prediction list:
Get address info of a
place_id
:Nova Field Usage:
This will create an auto-complete input.
When you click an option from the Address field, it will fill other fields like city, postal code, state, etc.
By default, the Address field will auto-complete the associated address fields based on their field names. The Place field will automatically fill fields named
address_line_2
,city
,state
,postal_code
. However, you may customize the field names that should be auto-completed using the following methods:secondAddressLine($column)
city($column)
state($column)
postalCode($column)
Fixes #72 #75