get city from geocoder results?

后端 未结 13 1915
我寻月下人不归
我寻月下人不归 2020-12-02 14:07

Having problems getting the different arrays content from geocoder results.

item.formatted_address works but not item.address_components.locality?

ge         


        
13条回答
  •  南方客
    南方客 (楼主)
    2020-12-02 14:48

                //if (arrAddress[ac].types[0] == "street_number") { alert(arrAddress[ac].long_name) } // SOKAK NO
                //if (arrAddress[ac].types[0] == "route") { alert(arrAddress[ac].short_name); } // CADDE
                //if (arrAddress[ac].types[0] == "locality") { alert(arrAddress[ac].long_name) } // İL
                //if (arrAddress[ac].types[0] == "administrative_area_level_1") { alert(arrAddress[ac].short_name) } // İL
                //if (arrAddress[ac].types[0] == "postal_code") { alert(arrAddress[ac].long_name); } // POSTA KODU
                //if (arrAddress[ac].types[0] == "neighborhood") { alert(arrAddress[ac].long_name); } // Mahalle
                //if (arrAddress[ac].types[0] == "sublocality") { alert(arrAddress[ac].long_name); } // İlçe
                //if (arrAddress[ac].types[0] == "country") { alert(arrAddress[ac].long_name); } // Ülke
    

提交回复
热议问题