0
我的应用在地图上有很多叠加层,我如何让地图不会太慢?就像在地图上移动时延迟了5秒。看看我的代码如何添加人员,有人可以告诉我如何解决这个问题,以便它不那么慢,我在地图上覆盖了大约80个覆盖图,并且增加了第二个。添加了多个叠加层后,android地图移动缓慢
ArrayList<String> lstotherslocation = MyGlobalInfomation.getOthersLocation();
List<Overlay> mapOverlays = gMapView.getOverlays();
Drawable drawable = this.getResources().getDrawable(R.drawable.otherslocation);
OthersLocationOverlay otherslocation = new OthersLocationOverlay(drawable,this);
mapOverlays.clear();
for(int i = 0; i < lstotherslocation.size();i++){
number = number + 1;
OthersPoint = new GeoPoint((int) (Double.parseDouble(lstotherslocation.get(i).trim())),
(int) (Double.parseDouble(lstotherslocation.get(i + 1).trim())));
OverlayItem overlayitem = new OverlayItem(OthersPoint, "Title",
"test: " + lstotherslocation.get(i+ 2) + "\n" +
"User: " + lstotherslocation.get(i+ 3) + "\n" +
"test: " + lstotherslocation.get(i+ 4) + "\n" +
"test: " + lstotherslocation.get(i+ 5));
i = i + 5;
otherslocation.addOverlay(overlayitem);
mapOverlays.add(otherslocation);
是的,我不确定你的代码与我的代码相比你要做什么。我的地图只是非常缓慢地翻转过来。 – user516883 2010-11-29 08:07:04