How to delete the shape(circle) on google map when tap on marker?

倖福魔咒の 提交于 2020-07-22 22:10:24

问题


I can add many markers and circles on google map with in "didTapAt" event, but I want to delete them as well, for markers I can do this in "didTap marker" event but how can I delete its shape not other shape?


回答1:


let circle = GMSCircle(position: CLLocationCoordinate2D(latitude: 40.7336299, longitude: 30.1616061, radius: 10)
 circle.isTappable = true
 circle.map = mapView

func mapView(_ mapView: GMSMapView, didTap overlay: GMSOverlay) {
    overlay.map = nil
}


来源:https://stackoverflow.com/questions/51591167/how-to-delete-the-shapecircle-on-google-map-when-tap-on-marker

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!