【发布时间】:2014-09-10 05:28:16
【问题描述】:
我正在制作一个应用程序,它将许多独特的标记绘制到地图片段(60 个标记)/我为此使用 ArrayList 和 for 循环来绘制它们。
我遇到的问题是,在缩小地图时,地图非常混乱,而且滞后。我想找到一种方法让标记在缩小时消失,例如在 11 级,然后从 10 级放大。我该怎么做?
// Get a handle to the xml Map Fragment
GoogleMap map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
ArrayList<LatLng> tree = new ArrayList<LatLng>()
tree.add(new LatLng(48.617515, -3.945385));
tree.add(new LatLng(49.617515, -3.945385));
... //x58
for (int i = 0; i < camLoc.size(); i++) { //for loop to add the LatLng data to the array list
map.addMarker(new MarkerOptions()
.position(camLoc.get(i)));
}
}
【问题讨论】:
-
当
onCameraChanged被调用时更新你的标记
标签: android google-maps-api-3 google-maps-markers