I am using Google maps services in iOS (Swift) and Android. In android, the map view has a method called animatreCamera
that has an animation in which the movem
Swift 4:
func delay(seconds: Double, closure: @escaping () -> ()) {
DispatchQueue.main.asyncAfter(deadline: .now() + seconds) {
closure()
}
}
Then call it :
delay(seconds: 0.5) { () -> () in
let zoomOut = GMSCameraUpdate.zoom(to: 10)
self.mapView.animate(with: zoomOut)
self.delay(seconds: 0.5, closure: { () -> () in
var vancouver = CLLocationCoordinate2DMake(49.26,-123.11)
var vancouverCam = GMSCameraUpdate.setTarget(vancouver)
self.mapView.animate(toLocation: vancouverCam)
self.delay(seconds: 0.5, closure: { () -> () in
let zoomIn = GMSCameraUpdate.zoom(to: 15)
self.mapView.animate(with: zoomIn)
})
})
}