【问题标题】:Android Sygic intentAndroid Sygic 意图
【发布时间】:2014-02-03 19:08:25
【问题描述】:

我按照http://dev.sygic.com/documentation/custom-url-schema/http://help.sygic.com/entries/22207668-Developers-Only-Sygic-implementation-to-your-app-Android-SDK-iPhone-SDK-Url-Handler- 的说明进行操作

我将坐标传递给 Sygic 12.991030334592057 作为纬度和 77.80791163444519 作为经度。

另一个 com.sygic.aura://coordinate|12.9138|77.6680|drive

但是 Sygic 说“坐标在地图之外。”

        String str = "http://com.sygic.aura/coordinate|" + latitude + "|"
            + longitude + "|" + type.toString();        
    startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(str)));

我也试过

        String str = "com.sygic.aura://coordinate|" + latitude + "|"
            + longitude + "|" + type.toString();        
    startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(str)));

编辑: 类型是枚举。 type.toString 将驱动器显示为字符串。

我做错了什么?

【问题讨论】:

  • 你如何解决这个问题?因为我也面临这个问题。

标签: android android-intent sygic


【解决方案1】:

遇到同样的问题。正如恩利所说,纬度,经度参数的顺序是相反的。这段代码对我有用:

String str = "com.sygic.aura://coordinate|" + lon + "|" + lat + "|" + type.toString();        
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(str)));

在我的手机中,这个示例调用启动了 sygic 并开始导航:

com.sygic.aura://coordinate|-3.588678|37.176278|drive

希望对你有帮助

【讨论】:

  • 它如何开始导航我的意思是它是否为您当前的位置和自定义纬度经度制定路线?
  • 它会启动 sygic 应用程序,并让您选择路线的起点。默认情况下,它是“我的位置”。
  • 它启动 sygic 但没有从我当前位置到给定纬度的路线。
  • 坐标顺序有点混乱IMO
【解决方案2】:

您的代码没有任何问题。你确定那些经度和纬度的值是正确的吗?您使用哪个应用程序获得了这些坐标?

我今天正在编写相同的代码,似乎我在纬度的位置使用了经度,反之亦然。尝试交换坐标。当我和你在同一条船上时,这对我有用。如果不是这种情况,请确保您拥有该位置的 Sygic 地图,方法是手动导航到该位置,方法是从菜单 > 导航到... > GPS 坐标导航到该位置。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-13
    • 2023-04-11
    相关资源
    最近更新 更多