解决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];

         }

    }

}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容