【发布时间】:2015-02-08 10:14:45
【问题描述】:
我正在使用谷歌地图 SDK 构建一个 iOS 应用程序。当用户执行 longPressAtCoordinate 时,我可以在地图上添加一些标记。我的问题是,当我尝试拖动标记时, diiLongPressAtCoordinate 在 didBeginDraggingMarker 之前触发,因此还会添加一个新标记。
-(void)mapView:(GMSMapView *)mapView didBeginDraggingMarker:(GMSMarker *)marker{
NSLog(@"begin dragging marker");
}
- (void)mapView:(GMSMapView *)mapView didLongPressAtCoordinate (CLLocationCoordinate2D)coordinate{
NSLog(@"did long press at mapview");
//when user didLongPressAtCoordinate I add a new marker on the map.
// I want to prevent the execution of this code before the didBeginDraggingMarker method
}
【问题讨论】: