ios - 将相机移动到底部 GMSMapView IOS

标签 ios swift google-maps gmsmapview

相机在 map 中的当前位置始终位于中心。请检查屏幕 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)
}

谢谢

Screen 1

Screen 2

最佳答案

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

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

关于ios - 将相机移动到底部 GMSMapView IOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53407573/

相关文章:

ios - 停止导航 Controller ?从滚动到底部时出现

ios - 更改 View 的父级

ios - 对尚未渲染的 View 进行快照会产生空快照。警告信息

ios - 删除应用程序后的应用程序首选项

javascript - UIAutomation 访问 TableView 时出现问题

ios - dyld`__abort_with_payload : dyld: Library not loaded: @rpath/SQLite. 框架/SQLite Xcode 9

具有谷歌地图 View 的 iOS 应用程序未触发 TouchEnded :withEvent: method

javascript - Google map 本地搜索 API : How to pass a query?

javascript - 谷歌地图 API : infoWindow flickers/closes automatically because of mouseout event

ios - 如何获取显示在 TableView 单元格中的数据并将其显示在文本字段中?