address_suggestion
The Address Suggestion module for Drupal is a robust alternative to the address autocomplete module, which is no longer actively maintained. Address Suggestion offers a set of enhanced features:
- Automatic address suggestions with country specificity,
- Configuration per Field widget (not in module settings)
- Support field text plain, field address
- Support CkEditor5
- Get country site by default (more precise)
- House number auto-addition
- Integration with Geo fields or Geolocation field
This module is support with various address providers, such as
- Vietnam Post - only in Vietnam - Free
- France Address - only in France - Free
- Swiss Post API - only in Swiss - Free (but not tested)
- Photon komoot - Free
- Nominatim Openstreetmap - Free
- Mapbox Geocoding - Free
- Here Maps - 30,000 transactions free per month
- Map quest - 15,000 transactions free per month
- Tomtom - 2,500 requests free per day
- Graph hopper - 500 requests free per day
- Distince Matrix - 5,000 requests free per month
- Bing Maps - 1,000 transactions free per month
- Google Maps (not tested - pm for key i will check it)
Formatter supports
- Open street map (free - no api)
- Esri ArcGIS (free - no api)
- Google map iframe (no api required)
- Mapbox
- Map quest
- Tom tom
- Here
Button autosuggestion in ckeditor5. It will embed google map
. Seek Developper for more options map: like apple map, bing map, ...
For developper
- For each provider can set your custom endpoint. You can create your own api in the server to save the new address if request is not found in the database, you will call the provider's api to get it and you save the new address on your server. That will save your money
- You can create your plugin just create your_module/src/Plugin/AddressProvider/your_request_api.php
views exemples in module
- If you want add address suggestion for your custom textfield with #autocomplete
you can active button Address suggestion in CkEditor5 (ex: full_html), you will get token in configuration.
$form['custom_text_field'] = [
'#type' => 'textfield',
'#title' => $this->t('Autocomplete Address'),
'#autocomplete_route_name' => 'address_suggestion.ckeditor',
'#autocomplete_route_parameters' => ['format' => 'full_html'],
'#autocomplete_query_parameters' => ['token' => $token],
....
];
If you find this module valuable, consider supporting the developer by buying me a ☕.