2012-01-12 16 views
2

私は経度と緯度をgoogleの方向api(http://code.google.com/apis/maps/documentation/directions/)に渡すことに問題があります私が間違っているの何、私はいつも何の結果を得るんですが、私は経度と緯度をgoogleの方向に渡すapi

+0

私は馬鹿です、私は緯度と経度が間違った方法で丸みを持っています –

+0

経度+ "、"経度はおそらくあなたが望むものではありません – njzk2

+0

それは間違いなくでした: ) –

答えて

2

に取り組む使用している場合、私はパーを置くことによって、問題を解決しました緯度が経度の前に来るべきである

4

使用して、その細かい

JSONObject jsonLocation = JSONfunctions.getJSONfromURL("http://maps.googleapis.com/maps/api/directions/json?origin=" + currentLongitude + "," + currentLatitude + "&destination=" + longitude + "," + longitude +"&sensor=true&region=gb"); 

おかげで、このコード

Intent intent = new Intent(
          android.content.Intent.ACTION_VIEW, 
          Uri.parse("http://maps.google.com/maps?saddr="+ latitude + "," + Longitude+ "&daddr="+latitudeDb+","+longitudeDb+"")); 
        intent.setClassName("com.google.android.apps.maps", 
          "com.google.android.maps.MapsActivity"); 
        startActivity(intent); 
+0

ありがとう、しかし私は結果をリストビューに入れたい –

関連する問題