【问题标题】:Android: Launch Google Maps AppAndroid:启动谷歌地图应用
【发布时间】:2011-08-16 07:18:45
【问题描述】:

我在另一个 Stack Overflow 帖子中看到,您可以通过在 URL 中传递两个地址作为参数从您的应用程序中打开 Google 地图应用程序。

String url = "http://maps.google.com/maps?saddr=some+address&daddr=another+Address"
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,  Uri.parse(url));

如何从您的应用程序启动 Google 地图应用程序并获取从您当前位置到某个地址的路线?

【问题讨论】:

    标签: android maps location directions


    【解决方案1】:

    当然可以,但您必须先通过 GPS 坐标获取您的位置。或者,只需设置第二个位置的位置,让用户点击它并使用地图本身从当前位置查找路线。

    【讨论】:

    • 所以我使用google api查找坐标然后将坐标作为参数传递?这是怎么做到的?
    • 我用谷歌找到了这个指导指南:firstdroid.com/2010/04/29/…
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多