java - 在android中的谷歌地图上添加图像

标签 java android eclipse google-maps geotagging

我想在谷歌地图上显示图像,但我不知道如何在 Android 中做到这一点。 与 Panoramio 相同 到目前为止,我已经完成了,我的 Android 应用程序捕获带有纬度、经度的图像,并将其保存在 sqllite 数据库中 .我想根据它们的经纬度在谷歌地图上填充这些图像。

最佳答案

首先你需要获取 map ,如下所示

private GoogleMap mMap;

mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();

然后您可以创建一个循环,在其中可以向 map 添加标记

for (all the items you want to add) {

    mMap.addMarker(new MarkerOptions()
    .position(LatLng(coordinates))
    .icon(BitmapDescriptorFactory.from where you have it));;
}

查看 Google 开发者网站中的信息 https://developers.google.com/maps/documentation/android/marker?hl=pt-PT

关于java - 在android中的谷歌地图上添加图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22404260/

相关文章:

java - RecyclerView 不显示我的数据

Eclipse 不启动 : JVM terminated. 退出代码=14

java - Glassfish 上的相互验证,连接中断

java - 如何拆分正则表达式这个字符串

java.nio.charset.MalformedInputException : Input length

iphone - 带标记的谷歌地图链接(在 iphone 和 android 上)

java - 如何获取 OkHttp3 重定向的 URL?

android - 如何更改回收者 View 的 subview onclick 的文本?

java - 错误 : JAVA_HOME is not set and could not be found after Eclipse installation

java - 配置 CMake C++/Java 项目以与 Eclipse 配合使用