【问题标题】:Open google map with particular motion mode Android Intent使用特定的运动模式 Android Intent 打开谷歌地图
【发布时间】:2015-06-15 05:25:47
【问题描述】:

您好我正在尝试使用默认意图打开谷歌地图方向并且我通过运动模式行走但它打开默认驾驶我如何以特定运动模式打开地图

我的代码

    uri = "http://maps.google.com/maps?saddr=" + sLatitude + "," + sLongitude + "&daddr=" + dLatitude + ","+ dLongitude + "&mode=walking";

    Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri));
    intent.setPackage("com.google.android.apps.maps");
    startActivity(intent);

Google map url for testing

【问题讨论】:

    标签: android google-maps android-intent


    【解决方案1】:

    我认为,您应该使用 google directions api 而不是普通链接。

    方向链接是:

    https://maps.googleapis.com/maps/api/directions/output?parameters

    mode的参数,可以改成walking,然后使用intent。

    更多详情请参考here

    【讨论】:

    • 您好,您可以为我的网址提供网址吗:“google.com/…
    • 我的要求是用特定的运动模式打开谷歌地图
    • 实际上我比较了很多默认和步行的 url。这似乎没有规则。你有什么发现吗?
    猜你喜欢
    • 2011-12-19
    • 2018-05-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-04
    • 2018-03-30
    • 2018-11-02
    相关资源
    最近更新 更多