Has anyone tried to build a street address lookup function that will ping Google Maps or something similar, and return discreet fields like street address, city, state, and postal code?
Can you get an address resolved to a standard format and populate other fields with it?
If you pick it in a module field the value will be set in there
Ok, that give you a map that will return a latitude/longitude in the geometry page block. Neat, but not quite what I’m after.
What I want to do is enter either a full or partial street address (similar to what the geometry block does), and have it return a validated address, broken up into street/city/state/postal code fields, from an authoritative source (such as the US Postal Service’s address validation API). Can this be done somehow?
Yes we are looking for automatic address suggested input as the user types. Anyone done that yet?
We don’t do this directly in Corteza, but we do use Google’s Places API in our front-end app (a user completes a simple text search to select an address), to help us populate the various components of an address, and the Geo coordinates into Corteza.
We populate the following fields:
- unit / level / office number
- street number
- street name
- suburb
- city
- province
- postcode
- country
It is an area for us that is verbose, because the way address data is expressed in Country A, can be very different in Country B, and in some countries like the Philippines, address formats are inconsistent.
Places API have many different “component levels”, so to avoid having more than the 8 address fields referred to above, we had to build some logic for each country, which is still a work in progress.
All I am trying to say is that getting an address lookup and converting that consistently into Corteza fields is not a trivial exercise, particularly if you are working in multiple jurisdictions.