我想在谷歌地图上显示图像,但我不知道如何在 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/