0
{    @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {

    if (requestCode == Place_Picker_Request){
        place_Picket = PlacePicker.getPlace(data,this);
        String nama = String.format("%s",place_Picket.getName());
        _txplaceName.setText("Name : "+nama);
        String address = String.format("%s",place_Picket.getAddress());
        _txplaceAddres.setText("Addres : "+address);
        String latlang = String.format("%s",place_Picket.getLatLng());
        _txplacePhoneNumber.setText("LatLng :"+latlang);

        "I will calculate distance betwen my location with latlang from placepicker"
        "and show in toast"


        Toast.makeText(MainActivity.this,"",Toast.Length_short).show();
        String url = String.format("%s",place_Picket.getWebsiteUri());
        _txplaceWebsite.setText("Alamat Website : "+url);


    }
    super.onActivityResult(requestCode, resultCode, data);
}}
4

1 回答 1

0

从 PlacePicker 你得到像 LatLang

final LatLng location = place.getLatLng();

而且你可以从 LatLng 中获得纬度和经度,比如

double lat = LatLng.latitude;
double lng = LatLng.longitude;

看到这个更多。

于 2017-10-21T11:12:33.683 回答