Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove GMSPolygon from GMSMapView

Does exist any way to remove GMSPolygons from GMSMapView?

It does not seem to exist a property of GMSMapView containing them (as GMSPlolyLines), should I clear the map and render all again?

thanks

like image 260
joseprupi Avatar asked Jul 11 '13 19:07

joseprupi


1 Answers

When you create the GMSPolygon you set its map property to add it to the map. To remove it from the map, set its map property to nil. This means you need to keep your own record of the polygons which you've added to the map, which you want to be able to remove later.

For example mySavedPolygon.map = nil

like image 186
Saxon Druce Avatar answered Oct 11 '22 23:10

Saxon Druce