vtex-apps / address-locator

VTEX address locator app to delivery store
3 stars 5 forks source link

Fix/search #25

Closed jgfidelis closed 5 years ago

jgfidelis commented 5 years ago

What is the purpose of this pull request?

Hoje: pegamos a cidade do endereço do google apenas pelo administrative_area_level_2.

Endereços do México nunca retornam com esse campo. Pelo que fiz testes, a cidade fica no campo locality

Endereço: La Mesa 30, Santa Fe, 83249 Hermosillo, Son., México

Retorno:

"address_components" : [
         {
            "long_name" : "30",
            "short_name" : "30",
            "types" : [ "street_number" ]
         },
         {
            "long_name" : "La Mesa",
            "short_name" : "La Mesa",
            "types" : [ "route" ]
         },
         {
            "long_name" : "Santa Fe",
            "short_name" : "Santa Fe",
            "types" : [ "sublocality_level_1", "sublocality", "political" ]
         },
         {
            "long_name" : "Hermosillo",
            "short_name" : "Hermosillo",
            "types" : [ "locality", "political" ]
         },
         {
            "long_name" : "Sonora",
            "short_name" : "Son.",
            "types" : [ "administrative_area_level_1", "political" ]
         },
         {
            "long_name" : "México",
            "short_name" : "MX",
            "types" : [ "country", "political" ]
         },
         {
            "long_name" : "83249",
            "short_name" : "83249",
            "types" : [ "postal_code" ]
         }
      ],
      "adr_address" : "\u003cspan class=\"street-address\"\u003eLa Mesa 30\u003c/span\u003e, \u003cspan class=\"extended-address\"\u003eSanta Fe\u003c/span\u003e, \u003cspan class=\"postal-code\"\u003e83249\u003c/span\u003e \u003cspan class=\"locality\"\u003eHermosillo\u003c/span\u003e, \u003cspan class=\"region\"\u003eSon.\u003c/span\u003e, \u003cspan class=\"country-name\"\u003eMéxico\u003c/span\u003e",
      "formatted_address" : "La Mesa 30, Santa Fe, 83249 Hermosillo, Son., México",
      "geometry" : {
         "location" : {
            "lat" : 29.0885564,
            "lng" : -110.9919014
         },
         "viewport" : {
            "northeast" : {
               "lat" : 29.08991203029149,
               "lng" : -110.9904336697085
            },
            "southwest" : {
               "lat" : 29.08721406970849,
               "lng" : -110.9931316302915
            }
         }
      },
      "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/geocode-71.png",
      "id" : "455d61a2c78fe42f9d0900b1b3013c886cb3cf93",
      "name" : "La Mesa 30",
      "place_id" : "ChIJ-y8XKQ-EzoYRodRvas0Uz0g",
      "reference" : "ChIJ-y8XKQ-EzoYRodRvas0Uz0g",
      "scope" : "GOOGLE",
      "types" : [ "premise" ],
      "url" : "https://maps.google.com/?q=La+Mesa+30,+Santa+Fe,+83249+Hermosillo,+Son.,+M%C3%A9xico&ftid=0x86ce840f29172ffb:0x48cf14cd6a6fd4a1",
      "utc_offset" : -420,
      "vicinity" : "Santa Fe"

Problema reportado pelo Thiago Baranda.

Screenshots or example usage

Types of changes