Reputation: 753
I want to fix the marker in the center of the google map in Swift and I do not want to use CMSCircle i want to fix the marker in the center and move map and marker not change place
Upvotes: 0
Views: 1453
Reputation: 862
You can add this extension to your view controller .The marker will move to the centre every time you move the map
extension MyMapViewController: GMSMapViewDelegate{
func mapView(_ mapView: GMSMapView, idleAt position: GMSCameraPosition) {
marker.position = position.target
reverseGeocodeCoordinate(coordinate: position.target)
}
}
Upvotes: 1