Multiple overlay items in android

前端 未结 3 1070
野趣味
野趣味 2021-02-04 22:52

I seem to be having a problem with using ItemizedOverlay and OveralyItems in it.

I can get the first overlayItem to appear on the map but not any items after that.

相关标签:
3条回答
  • 2021-02-04 23:14

    I have finally found an answer. I'm quite ashamed to admit it but the problem was not in the items not drawing but in me not seeing them on screen....The locations for the 2 items were supposed to be nearly identical...but one of them was calculated with a bug and was moved halfway round the world.

    So I never bothered to look or zoom out...when I did i found my other marker sitting somewehre in the Barren's sea :) Thanks to all who tried to help me...oh and the above code works :)

    0 讨论(0)
  • 2021-02-04 23:19

    I have working code that looks almost exactly like yours, except I do not call setLastFocusedIndex in my addOverlay function. Try commenting it out and see if it works.

    0 讨论(0)
  • 2021-02-04 23:21

    check this sample project it helps. add multiple addOverlay()s on ur multiple times

    0 讨论(0)
提交回复
热议问题