2012-01-12 53 views
2

我有問題傳遞經度和緯度到谷歌方向api(http://code.google.com/apis/maps/documentation/directions/)有誰能告訴我什麼我做錯了,我一直沒有得到結果,但如果我使用解決其精細傳遞經度和緯度到谷歌方向api

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

感謝

+0

我是個白癡,我得到了緯度和經度以錯誤的方式 – 2012-01-12 10:55:15

+0

經度+「」 +經度可能也不之前,你要 – njzk2 2012-01-13 09:10:00

+0

沒有絕對wasnt什麼: - ) – 2012-01-13 10:28:27

回答

2

我通過將比肩解決的問題按照正確的順序ameters,緯度應該來經度

4

使用此代碼

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

謝謝,但我想把結果放入列表視圖 – 2012-01-13 09:09:04

相關問題