将摄像头移动到底部GMSMapView IOS

将摄像头移动到底部GMSMapView IOS,ios,swift,google-maps,gmsmapview,Ios,Swift,Google Maps,Gmsmapview,当前相机在地图中的位置始终位于中心。请检查屏幕1 我想用偏移量将相机固定在底部,就像屏幕2一样 任何帮助都将不胜感激 let carBearing = self.getBearingBetweenTwoCoordinates(coordinate1: coordinate1, coordinate2: coordinate2) self.carMarker.position = coordinate1 let camera = GMSCameraPosition.camera(withTar

当前相机在地图中的位置始终位于中心。请检查屏幕1

我想用偏移量将相机固定在底部,就像屏幕2一样

任何帮助都将不胜感激

let carBearing = self.getBearingBetweenTwoCoordinates(coordinate1: coordinate1, coordinate2: coordinate2)

self.carMarker.position = coordinate1

let camera = GMSCameraPosition.camera(withTarget: coordinate1, zoom: Constants.GoogleMapInfo.KZOOM_LEVEL_20, bearing: carBearing, viewingAngle: 65)

DispatchQueue.main.async{
    self.mapView.animate(to: camera)
}
谢谢


您可以通过为mapview提供填充来实现这一点

let mapInsets = UIEdgeInsets(top: 20.0, left: 0.0, bottom: 150, right: 0.0)
self?.mapView.padding = mapInsets

能否添加一些用于地图和定位其相机的代码。@添加了user832示例代码。谢谢