【发布时间】:2014-11-21 09:36:19
【问题描述】:
有没有办法在 Android 上的 Google Maps/Earth 应用中打开本地 KML/KMZ 文件?尝试了以下方法,但没有奏效。
Intent mapIntent = new Intent(Intent.ACTION_VIEW);
Uri uri1 = Uri
.parse("geo:0,0?q=file:///mnt/sdcard/doc.kml");
mapIntent.setData(uri1);
startActivity(Intent.createChooser(mapIntent, "Sample"));
如果不是,并且如果我们只能指定托管在网络上的链接,那么我们是否可以指定指向 Google Drive 文件的链接以直接显示在 Google Maps/Earth 上?
Intent mapIntent = new Intent(Intent.ACTION_VIEW);
Uri uri1 = Uri
.parse("geo:0,0?q=https://drive.google.com/open?id=0B8n3LAJCTg-8eml4TTBoZDlRd00&authuser=0");
mapIntent.setData(uri1);
startActivity(Intent.createChooser(mapIntent, "Sample"));
最后,Google 地球中的游玩游览功能发生了什么变化?它曾经可以工作,但随着最新更新,它已损坏并且不再工作。
File file = new File(playFileNameKml);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file),
"application/vnd.google-earth.kml+xml");
intent.putExtra("com.google.earth.EXTRA.tour_feature_id", "tour");
startActivity(intent);
【问题讨论】:
标签: android google-maps kml google-earth kmz