Associate an object with Marker (google map v2)

前端 未结 3 1304
梦谈多话
梦谈多话 2020-12-24 12:26

In my app I have some objects that have their location displayed on the map using markers. The problem is that the only way I\'ve found to handle marker clicks is

         


        
3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-24 12:42

    Another option would be to create a Map whose keys is marker.getId() and the value is our object.

    In this way, we wouldn't keep a reference to a Marker in memory, and wouldn't have to worry about garbage collected markers.

    Here you can see more answers.

提交回复
热议问题