Statamic Google Maps Autocomplete is a Statamic addon that does something pretty neat.
This addon does:
- This
- And this
- And even this
Add the following to your composer.json:
"repositories": [
{
"type": "vcs",
"url": "https://github.com/steadfast-collective/statamic-google-maps-autocomplete.git"
}
]
Then run
composer require steadfast-collective/statamic-google-maps-autocompleterun
php artisan vendor:publish
and select SteadfastCollective\StatamicGoogleMapsAutocomplete\ServiceProvider
add the following to your env
GOOGLE_MAPS_API_KEY=XXX
GOOGLE_MAPS_ID=XXX
For the Map ID, refer to (Google's docs)[https://developers.google.com/maps/documentation/get-map-id]
Add the "Google Maps Autocomplete" field to a blueprint. You can also select up to 5 countries to limit the autocomplete results to.
{{ field_name:{property} }}
Available properties:
- street_number
- route
- locality
- administrative_area_1
- country
- postal_code