0

我通过传递纬度经度值在谷歌地图上显示一个位置。

Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.setData(Uri.parse("geo:0,0?q=" + (" "+dblLatitude+", "+dblLongitude+" ")));

        try {
            startActivity(intent);
        } catch (Exception e) {
            e.printStackTrace();
        }
        setContentView(R.layout.map_locate);
    }

它对我来说工作正常。但我也想在定位点上方显示文本。知道如何像传递 lat、long 值一样动态传递文本吗?

4

4 回答 4

0

试试这个

gMap.addMarker(new MarkerOptions()
    .position(fakeMarker)
    .title("Favoris")
    .icon(BitmapDescriptorFactory.fromResource(R.drawable.pin_favoris))
);
于 2013-05-13T07:32:08.690 回答
0

您可以使用intent 对象上的putExtra(String,String)方法将额外的数据放入intent 对象中。

于 2013-05-13T07:38:46.020 回答
0

当您触发打开本机 Google 地图应用程序的意图时。我不认为你想要达到的目标是可能的。AFAIK 您可以添加到所需位置的所有内容都是一个图标。

如果您想为其添加更多功能,则必须开发自己的地图应用程序。

更新:

要开发你自己的地图,你可以看看我写的这篇博文:

谷歌地图 API V2

如果您有任何问题,请不要犹豫。

于 2013-05-13T07:58:24.353 回答
0

要在 Google 地图应用程序上显示标签,您必须将其添加到坐标后的括号中。

看到这个答案:https ://stackoverflow.com/a/7405992/2183804

于 2013-05-13T09:51:39.497 回答