I have the following code:
func mapView(mapView: GMSMapView, didTap marker: GMSMarker){
let lat: CLLocationDegrees = marker.position.latitude
let lng: CLLocationDegrees = marker.position.longitude
var formattedCoordinate = CLLocationCoordinate2D(latitude: lat,longitude: lng)
markersArray.remove(formattedCoordinate)
self.clean()
}
func mapView(mapView: GMSMapView, didBeginDragging marker: GMSMarker){
let lat: CLLocationDegrees = marker.position.latitude
let lng: CLLocationDegrees = marker.position.longitude
var formattedCoordinate = CLLocationCoordinate2D(latitude: lat,longitude: lng)
markersArray.remove(formattedCoordinate)
}
As you can see I am trying to "remove" the "formattedCoordinate" from markersArray. I saw that there are options like .filter and other methods which enables removing an element at a specific index, but here I would like to remove that specific coordinate from the array. How do I do that?