Android: ItemizedOverlay onTouchEvent and onTap overlapping

前端 未结 3 1860
滥情空心
滥情空心 2020-12-15 14:49

I am trying to place a marker on a map overlay and then present a dialog when the user selects the drawable. The problem is the events seem to overlap. After I click the m

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-15 15:21

    If you are updating the previous overlay, set isFirst=true; in the call to `remove() to remove the overlay in question.

    In the onTap() call, use

    if(isFirst)
    {
        isFirst=false;
    } else{
        // the actual onTap() comes here
    }
    

    I hope that it'll work the same if isFirst=true is set in the onDraw() as well.

提交回复
热议问题