0
PlacePickerから
{ @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); 
}} 
+0

[2つの緯度経度点間の距離を計算しますか? (Haversine formula)](https://stackoverflow.com/questions/27928/calculate-distance-between-two-latitude-longitude-points-haversine-formula) – Simo

+0

はい、placepickerにはgetl​​atlang()のmerthodがあります場所のピッカーからちょうどlotituteとlongituteを得る??私を助けてください –

答えて

0

あなたは

final LatLng location = place.getLatLng(); 

ようLatLangを取得し、あなたは、緯度と経度を取得することができますよりも、 LatLngのように

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

を参照してください。詳細はをご覧ください。

関連する問題