Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

169
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda