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具有正確的值,但相機不具有動畫效果。我錯過了什麼嗎?