3

我正在使用以下代码使用 Google Earth Android 意图飞到特定的纬度和经度:

Intent myIntent = new Intent(); 

myIntent.setClassName("com.google.earth", "com.google.earth.EarthActivity"); 
myIntent.setAction(Intent.ACTION_SEARCH); 
myIntent.putExtra(SearchManager.QUERY, lat + " " + lon);

这工作得很好,除了它似乎想将纬度/经度地理编码到最近的地址,如果一个在一定范围内。也就是说,如果纬度/经度位于南极洲中部,则地图以给定点为中心,但如果坐标是狮身人面像的坐标,则地图以开罗亚历克斯沙漠路的某个地址为中心,有一段距离离开。

有没有办法让 Android 版 Google 地球在所有情况下都只显示给定的纬度/经度?

4

1 回答 1

4

尝试这个:

Uri uri = Uri.parse("geo:38.899533,-77.036476");
Intent it = new Intent(Intent.Action_VIEW,uri);
startActivity(it);
于 2011-02-23T22:07:38.473 回答