0
我正在使用iOS中的Google地图。我想动画我的相机,以显示所有需要的经纬度。我将这些位置存储在数组中(作为CLLocationCoordinate2D实例)并使用GMSCoordinateBounds类来添加这些位置。这是我的代码:(iOS Swift)谷歌地图animateWithCameraUpdate无法正常工作
let bounds = GMSCoordinateBounds()
bounds.includingCoordinate(firstLocation)
bounds.includingCoordinate(lastLocation)
let camUpdate = GMSCameraUpdate.fit(bounds, withPadding: 60)
mMapView.camera = GMSCameraPosition.camera(withLatitude: firstLocation.latitude, longitude: firstLocation.longitude, zoom: 18)
mMapView.animate(with: camUpdate)
firstLocation和lastLocation具有正确的值,但相机不具有动画效果。我错过了什么吗?