Swift Google Maps-轻按标记时如何在屏幕底部移动标记?

Ale*_*y K 2 google-maps ios swift

我正在玩google地图,我需要覆盖点击标记的默认行为-默认情况下,标记会移至屏幕中心,并且信息窗口会显示在上方。我需要找出一种方法,当点击标记时,标记移到屏幕底部,而信息窗口显示在中间。我在这里找到了解决方案但无法将其转换为快速解决方案

有什么帮助吗?

Ale*_*y K 5

func mapView(mapView: GMSMapView!, didTapMarker marker: GMSMarker!) -> Bool {

    mapView.animateToLocation(marker.position)
    mapView.selectedMarker = marker

    var point = mapView.projection.pointForCoordinate(marker.position)
    point.y = point.y - 200

    var newPoint = mapView.projection.coordinateForPoint(point)
    var camera = GMSCameraUpdate.setTarget(newPoint)
    mapView.animateWithCameraUpdate(camera)

    return true

}
Run Code Online (Sandbox Code Playgroud)