开始 Google 使用经度和纬度时导航地图不起作用

Start Google Maps for navigation not working when using longitude and latitude

我的 android 应用程序中有我的经度和纬度值,我将它们传递给 url,正如官方 android 文档所说,就像这样 -

 String query_string = "google.navigation:q=" +location.getLatitude()+","+location.getLongitude();
 Uri gmmIntentUri = Uri.parse(query_string);
 Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
 //mapIntent.setPackage("com.google.android.apps.maps");
 startActivity(mapIntent);

Google 地图打开安静好,但它允许说找不到路线。

而且我可以看到我在 Google 地图地址栏中传递的经度和纬度值。它显示 'finding best route',然后显示错误消息 'no route found'。它也发生在所有模式(步行,驾驶......)。不知道为什么。

我看过你的截图了。我看到您正在尝试查找从您当前位置到坐标 3.2949945,6.5993606 的行车路线。

然而,3.2949945,6.5993606位于几内亚湾内海域。您可以在地理编码器工具中看到这一点:

https://developers-dot-devsite-v2-prod.appspot.com/maps/documentation/utils/geocoder/#q%3D3.294995%252C6.599361

我猜你的目的是找到一条通往 6.5993606,3.2949945 的路线:

https://developers-dot-devsite-v2-prod.appspot.com/maps/documentation/utils/geocoder/#q%3D6.599361%252C3.294995