Android Map Performance poor because of many Overlays?

后端 未结 3 2065
臣服心动
臣服心动 2021-02-10 03:33

I have a map in my android application that shows many markers (~20-50). But the app performs very poor when i try to scroll/zoom (in Google Android Maps i did a sample search f

3条回答
  •  情书的邮戳
    2021-02-10 03:51

    If I understand how this works correctly, you should not be calling populate after every add an overlay. You should do it once you've added them all. I think what's happening is that you add the first OverlayItem and call populate() so it adds that to the ItemizedOverlay. Then you add a second OverlayItem to the list and call populate() and it adds those two overlays to the ItemizedOverlay resulting in three items in the overlay. So I think you're getting way more than the 20-50 that you think.

提交回复
热议问题