Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

161
Views
iOS - Animate to a location while showing all the markers in GMSMapView

I want to animate to a specific location while showing all the markers i have pinned on Google map .

I am able to animate to a location but it is not showing all the markers.

I have tried the following solution (answer link) .

I am calling hover(to location:) for each location i want to animate:

func viewAllMarkers() {
  var bounds = GMSCoordinateBounds()
  for marker in yourArrayOfMarkers {
        bounds = bounds.includingCoordinate(marker.position)
  }
  let update = GMSCameraUpdate.fit(bounds, withPadding: 60)
  mapView.animate(with: update)
}

func hover(to location: CLLocationCoordinate2D) {
   viewAllMarkers()
   mapView?.animate(toLocation: location)
}

But it does not work . It animates to a location but does not show all the markers in GMSMapView . How to do both at the same time ?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!