如何从GMSMapView中删除GMSPolygon [英] How to remove GMSPolygon from GMSMapView

查看:176
本文介绍了如何从GMSMapView中删除GMSPolygon的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



它似乎不存在包含它们的GMSMapView属性(如GMSPlolyLines),我应该清除地图吗?

是否存在任何方式从GMSMapView中删除GMSPolygon?并再次渲染?



感谢

解决方案

GMSPolygon 您将其 map 属性添加到地图中。要从地图中删除它,请将其 map 属性设置为 nil 。这意味着您需要保留自己添加到地图中的多边形记录,以便以后能够将其删除。


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

解决方案

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.

这篇关于如何从GMSMapView中删除GMSPolygon的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆