Remove particular GMSMarker from GMSMapview using Google Map sdk in ios

后端 未结 9 3161
-上瘾入骨i
-上瘾入骨i 2021-02-19 23:18

I am integrating google maps sdk. Its all work fine. But how to remove particular Marker(Pin Point) when second will appear.(I am not using Mapkit)

I want the following:

9条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-20 00:08

    loop all marker in the map , and you can use title or snippet to decide which marker you remove

    as map.markers is no longer to use in google map ios sdk , you need to have a nsmutablearray to store all marker for looping purpose

    and you can make use of userData of the marker , marker.userData , which i prefer to store a nsdictionary information in the marker in order to prevent from duplicate name of title .

    cheers.

提交回复
热议问题