解决iiOS集成高德SDK、原生地图,自定义mark重复点击无效问题

原因是didSelectAnnotationView方法选中了该按钮,选中后需要通过deselectAnnotation取消当前的选中状态


-(void)mapView:(MKMapView*)mapView didSelectAnnotationView:(MKAnnotationView*)view

{

    if ([view isKindOfClass:[RYHomeMapOwnerCustomAnnotionView class]]) {

        RYHomeMapOwnerCustomAnnotionView *AnnotionView = (RYHomeMapOwnerCustomAnnotionView *)view;

        RYLog(@"%@",AnnotionView.OwnerAnnotation.baggage_id);

        if ([RYLoginSuccessModel shareUserModel].isLogin) {

            RYHomeMapOwnerAnnotation *model = AnnotionView.OwnerAnnotation;

            RYSureGoodsDemandController *SureGoods = [[RYSureGoodsDemandController alloc]init];

            SureGoods._ID= model.baggage_id;

            SureGoods.Type = GoodDemandType_MineLookOtherApplyCarray;

            [self.navigationController pushViewController:SureGoods animated:YES];

            [mapViewdeselectAnnotation:view.annotation animated:YES];

        }else

         {


            ClassclassName =NSClassFromString(@"RYLoginViewController");

            UIViewController*controller = [[classNamealloc]init];

            [self.navigationController pushViewController:controller animated:YES];

             [mapView deselectAnnotation:view.annotation animated:YES];

         }

    }

}

你可能感兴趣的:(解决iiOS集成高德SDK、原生地图,自定义mark重复点击无效问题)