Closed XianHain closed 7 months ago
Thanks for raising the issue… Do you know when premise and subpremise were added to the response?
How would you expect these to be added to the address… maybe in Address Line 1.
I'm mapping two different datasets / formats Google Geocode to the CommerceGuys addressing model
Hows this for a plan… If there's a premise, subpremise or floor in the Google data I'll add that to Line 1 and the street number and name to Line 2… if those values don't exist I'll add the street number and name to Line 1.
@CRHain88 According to https://github.com/newism/craft3-fields/issues/32#issuecomment-414557769 the street address must always be before the premise, subpremise?
Reference: UPS Secondary Address Unit Designators: https://pe.usps.com/text/pub28/28c2_003.htm
Reference Australian Addressing Standards: https://auspost.com.au/content/dam/auspost_corp/media/documents/Appendix-01.pdf
@CRHain88 UPS provides an alternative position for Secondary Address Unit Designators
@leevigraham Typical convention for US Addresses is as follows:
street_address
premise
subpremise
locality
administrative_area_level_1
postal_code
country
the street address must always be before the premise, subpremise?
Whether you decide to put street_address
above or below premise
and subpremise
is a matter of taste but very confusing without field labels. Many forms I've seen will say things like "Street Address", "Apt/Bldg/Ste".
This is only a concern in the control panel, I can handle the positioning of these elements in my templates.
Hows this for a plan… If there's a premise, subpremise or floor in the Google data I'll add that to Line 1 and the street number and name to Line 2… if those values don't exist I'll add the street number and name to Line 1.
I think it would be better to label the input fields and perhaps expose that data for the twig templates to arrange as the end-user sees fit. I would have to test for premise
accross several addresses to see what Google populates it with.
@leevigraham - this is related to my earlier issue, btw.
@CRHain88 revisting this backlog issue… The main challenge here is the way the google autocomplete api maps to the addressing bundle which handles all the country / state / city localisation and layout. The addressing bundle data model is different: https://github.com/commerceguys/addressing#data-model I probably need to rethink the purpose of the address field and explain it better.
Sprout Address Fieldtype for reference does the same thing: https://sprout.barrelstrengthdesign.com/docs/fields/address-field.html#templates
The Autocomplete box does not populate the
name
orsubpremise
(apt/suite/etc) valuesExpected Behavior
When using autocomplete to find a location (example, "Mailchimp Atlanta United States"), the value "Mailchimp" would be populated in the company field, "675 Ponce De Leon Ave NE" would populate in the first Address field, and "Suite 5000" would populate in the second Address field.
Actual Behavior
When using autocomplete to find a location (example, "Mailchimp Atlanta United States"), the value "675 Ponce De Leon Ave NE" populates in the second Address field, and the Company field and first Address field are left empty.
Notes
As pointed out in #32, it's confusing for US users when the street address is populated on the second line. It would be nice if there was a way for the plugin to swap fields depending on the user's locality.