Untitled
unknown
plain_text
5 days ago
1.9 kB
2
Indexable
Never
onPress={(data, details = null) => { // console.log("data detail",JSON.stringify(data)); console.log("data detail", JSON.stringify(details)); if (details.address_components != null) { details.address_components.map((index, key) => { if (index.types != null) { index.types.map((i, k) => { if (i == "administrative_area_level_1") { setnameProvinsi(index.long_name); } else if (i == "administrative_area_level_2") { setnameKabupaten(index.long_name); } else if (i == "administrative_area_level_3") { setnamekecamatan(index.long_name); } }); } }); } if (details.address_components != null) { details.address_components.map((index, key) => { console.log("long name", index.long_name); }); } if (data != null) { if (data.description != null && data.description != "") { setaddress(data.description); } } if (details != null) { if (details.name != null && details.name != "") { settitle(details.name); } if (details.geometry != null) { if (details.geometry.location != null) { if ( details.geometry.location.lat != null && details.geometry.location.lat != "" ) { setlot(details.geometry.location.lat); } if ( details.geometry.location.lng != null && details.geometry.location.lng != "" ) { setlong(details.geometry.location.lng); } } } } }}
Leave a Comment