【问题标题】:Displaying multiple location on google map android在谷歌地图android上显示多个位置
【发布时间】:2013-03-24 15:43:37
【问题描述】:

我有一组地址,我想在地图上显示它们(我知道方向是不可能的)。我使用 INTENT 但它只显示 1 个地址!我怎样才能让它显示所有地址 这是我的代码:

    for(int j=0; j<jarElements.length(); j++){
                        JSONObject distanceObj = jarElements.getJSONObject(j).getJSONObject("distance");
                        distanceStr = distanceObj.getString("value");
                        Log.v("finally getting distance : ", distanceStr);
                        buff.append("Distace from the location " + Addresses[j] + " is : " + distanceStr).append("\n").append("\n");
                        Intent is = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("http://maps.google.com/maps?saddr=" + Addresses[j] + "&daddr=" + distanceStr));
startActivity(Is);

【问题讨论】:

标签: android arrays google-maps android-emulator geolocation


【解决方案1】:

您在此处执行的操作将向 Google 地图应用程序发出请求,以获取从 Addresses[j]distanceStr 的方向,这将打开 Google 地图应用程序以返回方向命令。 这是您编写的 Intent 的正常行为。

AFAIK 无法显示从 android 到多个位置的路线。可以通过 Google 地图网络服务完成。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-05-11
    • 1970-01-01
    • 1970-01-01
    • 2019-06-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多