移动谷歌地图,但不是像优步这样的标记

Par*_*oni 1 google-maps ios swift

我正在开发一个使用谷歌地图的应用程序.我希望标记引脚在屏幕中心稳定,如果我移动地图,则不应移动引脚.

当我离开地图时,我希望地图中的地址保持稳定的标记ID.

任何帮助将不胜感激

Par*_*rda 8

你可以用这些东西

mapView.delegate = self;


func mapView(_ mapView: GMSMapView, idleAt position: GMSCameraPosition) {
    let coordinate = mapView.projection.coordinate(for: markerView.center)
    print("latitude " + "\(coordinate.latitude)" + " longitude " + "\(coordinate.longitude)")
}
Run Code Online (Sandbox Code Playgroud)

现在,您需要在中心的mapview顶部添加一个imageview,它将与uber一样工作.

请记住,图钉图标的高度应加倍.

如果需要,您可以使用此图标 图像