添加在谷歌地图API V2多个标记 [英] Adding multiple markers in Google Maps Api v2
问题描述
我成功设法显示谷歌地图API第2版。我想补充标记为我上的立场。
I have successfully managed to show the google map api v2. I want to add markers for my positions on it.
根据文件,我只能添加一个标记在同一时间,或必须使用循环来添加多个。
As per the documentation, I am only able to add one marker at a time or have to use a loop to add multiple.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.demo_v2);
googleMap = ((SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map)).getMap();
googleMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);
googleMap.setMyLocationEnabled(true);
Marker marker = googleMap.addMarker(new MarkerOptions().position(ROMA).title("Hello").snippet("Nice Place").icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_launcher)));
}
我的问题是,如果我有一组10 LatLon值和自定义图像,我怎么可以显示多个标记在API第2版。
My question is, if I have a set of 10 LatLon values and the custom images, how can i show the multiple markers in API v2.
感谢
推荐答案
试试这个<一href="http://stackoverflow.com/questions/13855049/how-to-show-multiple-markers-on-mapfragment-in-google-map-api-v2">Link 。最好是使用与放大器;这将有助于如何添加多个标记与Android的谷歌地图API V2文本
Try this Link . It is best to use & It will help to how to Add Multiple markers with text on Android Google Maps API v2
这篇关于添加在谷歌地图API V2多个标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!