【问题标题】:Android, draw route on google mapAndroid,在谷歌地图上绘制路线
【发布时间】:2011-06-07 06:28:43
【问题描述】:

在我的 android 项目中,我想在 Google 地图上绘制路线。我有起点和终点的坐标。在这一点上,我从谷歌网络服务获得km-file,其中包含跨路线的点。为了绘制部分路线,我使用Overlay 类的实例。这个解决方案有效,但速度很慢。还有其他方法可以做到这一点吗?可能存在使用内置谷歌地图应用程序或任何其他方式的能力吗?

【问题讨论】:

  • 我认为,这是您目前唯一的选择。

标签: android api google-maps geolocation google-directions-api


【解决方案1】:

好吧,你可以通过这样的意图使用内置的谷歌地图应用程序:

Intent intent = new Intent(android.content.Intent.ACTION_VIEW, 
Uri.parse("http://maps.google.com/maps?saddr=20.344,34.34&daddr=20.5666,45.345"));
startActivity(intent);

查看this question了解更多详情

【讨论】:

    【解决方案2】:

    这里有一个使用 KML 的教程: http://csie-tw.blogspot.com/2009/06/android-driving-direction-route-path.html

    这里还有一些示例代码: How to draw a path on a map using kml file?

    这一切看起来都是很多过于复杂的艰苦工作 - Google 应该为此提供 API。

    【讨论】:

      猜你喜欢
      • 2013-06-23
      • 1970-01-01
      • 2014-03-19
      • 2021-06-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多