A complex example of address validation
A more complex example of address validation. We will create a component to facilitate the customer’s address entry, for example, on an e-commerce website, and at the same time, we will verify that the entered address is valid and that we can deliver goods to it.
What is a valid address
- A valid address corresponds to a specific location (house, company, …)
- We can determine the exact GPS coordinates for this location
- We can provide a postal address for this location
- The address is deliverable
Scenarios to address
- Allow the client to comfortably enter a valid address
- Convert textual information (address entered in an external system) into a valid address
Why do we need valid addresses
- We want accurate information about customers
- We want to minimize failed deliveries
- We want to reduce human errors and typos when entering addresses
Sample Solution
In the sample solution, we enable autocomplete for the address as it is being entered, breakdown into individual components (street, city, …) and manual entry of these components, and final validation (verification of existence) of the address with potential alternative suggestions. All this is achieved using the Geocoding functions Suggest and Geocode.
The example is just a demo with a simple UI; it is not a production component.
- Source code – https://github.com/seznam/mapi-address-example
- Runnable demo – https://seznam.github.io/mapi-address-example