访问与[我的地图"在谷歌地图在Android [英] Access "My Maps" in Google Maps from Android

查看:135
本文介绍了访问与[我的地图"在谷歌地图在Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想写一个应用程序,以显示在谷歌地图我的自定义地图的一个标志。如何访问这些数据?必须有它的API,但我找不到任何地方的信息。

I want to write an app to display markers from one of my custom maps in Google Maps. How do I access this data? There must be an API for it but I can't find information anywhere.

推荐答案

如果您已经创建了通过浏览器工具谷歌我的地图地图,可以链接只是复制到我的地图,然后将它传递给谷歌地图应用在设备上。

If you have created a Google My Maps map through the browser tools, you can just copy the link to your My Map and then pass it to the Google Map Application on the device.

Intent intent = new Intent("android.intent.action.VIEW");
intent.setComponent(ComponentName.unflattenFromString("com.google.android.apps.maps/com.google.android.maps.MapsActivity"));
intent.addCategory(android.intent.category.LAUNCHER);
// replace string with your Google My Map URL
intent.setData("Your Google My Map URL HERE");
startActivity(intent);

我不相信的MapView API支持我的地图,这样一个路径是,如果你想查看你的数据要使用谷歌地图应用程序。

I don't believe that the MapView API supports My Maps, so one path is to use the Google Map application if you want to view your data.

或者你可以将其导出了我的地图作为KML和自己解析它为您的应用程序,但你有责任放下所有的POI标记等。

Or you could export it out of My Maps as KML and parse it yourself for your app, but then you are responsible for putting down all of the POI markers, etc.

更新2011-04-13:

Update 2011-04-13:

<击>如果加上参数输出= KML'你谷歌我的地图链接的网址,你可以得到你的地图的KML文件。 KML只是包含所有的点的XML文件该地图上的兴趣与纬度/经度和详细信息。一旦你分析文件,你想用什么样的数据。

If you add on the parameter 'output=kml' to your Google My Maps link URL you can get the KML file of your map. KML is just an XML file containing all of the points of interest on that map along with lat/long and details. Once you parse the file, do what you want with the data.

更新二〇一五年五月二十零日:

Update 2015-05-20:

看起来像谷歌我的地图的新版本有KML导入和导出功能。您可以为KML文件或网络链接到KML文件导出。

Looks like the new version of Google My Maps has KML import and export capabilities. You can export as a KML file or a network link to the KML file.

请参阅:
谷歌我的地图常见问题

这篇关于访问与[我的地图&QUOT;在谷歌地图在Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆