添加在谷歌地图API V2多个标记多个、标记、地图、API

2023-09-06 00:57:01 作者:我叫墨颜姑娘@

我成功设法显示谷歌地图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.

感谢

推荐答案

试试这个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