首页 / 浏览问题 / 移动GIS / 问题详情
android addCallout超过250个就在地图上看不到了
121EXP 2021年09月06日
二维地图上 调用addCallout 加载到地图上 加载250个Callout没问题 第251个以及以后的Callout地图上就看不见了 ,callout有数量限制吗?

1个回答

您好,callout是有个数限制的,目前限制在500个以内,刚测试添加500个callout地图可以正常显示。可以参考以下代码:
 

    for(int i =0;i<1000;i++) {
        Point2D pt = getPoint();
        LayoutInflater lfCallOut = getLayoutInflater();
        View calloutLayout = lfCallOut.inflate(R.layout.callout2, null);

        Button btnSelected = (Button)calloutLayout.findViewById(R.id.btnSelected);
        calloutLayout.setRotation(45);
        btnSelected.setText("test");
        btnSelected.setTag(2);
        CallOut callout = new CallOut(MainActivity.this);
        callout.setContentView(calloutLayout);
        callout.setCustomize(true);
        callout.setLocation(pt.getX(), pt.getY());
        m_mapView.addCallout(callout);

        m_mapView.showCallOut();

}
9,127EXP 2021年09月07日
...