A fresh start for Easy Address Field
When I first dipped my toe into plugin development during the Craft 2 days, a dedicated field for addresses was the first plugin I released. I made the first commit in October 2017, and it was high time to give the codebase some extra attention.
Google Geocoding service
At launch, the plugin used the Google Geocoding API. However, Google is quite specific about how you should and should not restrict this particular API in a very peculiar way, which led to many support requests.
In 2020, for version 3.0, I replaced Google with Nominatim, a free, zero-configuration service. Just install the plugin, and you’re ready to go.
However, about six months ago, the Nominatim API became much stricter about rate limiting, causing issues for sites with numerous locations or addresses.
In the latest release, I reintroduced support for Google’s API, giving users the option to choose between Nominatim and Google.
Craft Address elements
Since Craft 5, Craft has its own Address element and field, which you can easily add to any entry or section. That element includes fields for latitude and longitude but does not offer a way to obtain coordinates for an address.
In the latest release of Easy Address Field, you can now enable geocoding for those fields as well—using the geocoding service you’ve configured in the plugin.
Bring your own geocoding service
Adding support for multiple geocoding services was a great opportunity to use an event to register them. This also allows you to register your own geocoding service if desired (e.g., Geoapify, Mapbox, etc.).
Check out the documentation for a code sample—and feel free to get in touch if you encounter any issues!