<分区>
我正在开发一个使用 Google map 的应用程序。 我想要一个标记图钉稳定在屏幕中央,如果我移动 map ,图钉不应该移动。
当我离开 map 时,我想要 map 中稳定标记 ID 所在的地址。
任何帮助将不胜感激
标签 ios swift google-maps
<分区>
我正在开发一个使用 Google map 的应用程序。 我想要一个标记图钉稳定在屏幕中央,如果我移动 map ,图钉不应该移动。
当我离开 map 时,我想要 map 中稳定标记 ID 所在的地址。
任何帮助将不胜感激
最佳答案
你可以用这个东西
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)")
}
现在您只需在中心的 mapview 顶部添加一个 imageview,它的工作方式与 uber 相同。
请记住图钉图标的高度应加倍。
关于ios - 移动谷歌地图但不像优步那样移动标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46049128/