Get all GMSMarker from mapview and remove all marker without using mapview.clear()
Asked Answered
R

1

7

I have drawn path with marker in google map. So the path is static but marker needs to change their positions. How can I remove all markers without using mapview.clear(), because it will clear my path also from the map.

Any solution?

Reluct answered 11/10, 2017 at 10:14 Comment(0)
G
6

I guess you will have to keep all markers in an array(eg. allMarkers). Then,

for marker in allMarkers {
    marker.map  = nil
}
Garnettgarnette answered 11/10, 2017 at 10:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.