Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 Swift 3,我想在我的地图视图中创建一个移动标记,这样如果用户触摸屏幕并移动了标记也会随着页面移动。
我怎样才能解决这个问题?
使用GMSMapViewDelegate方法:
地图视图:didChangeCameraPosition:
在此方法中将 GMSMarker设置在相机位置。
此方法在地图中相机位置发生变化时调用。
func mapView(mapView: GMSMapView, didChangeCameraPosition position: GMSCameraPosition) { // Apply set marker logic here }