美文网首页
解决iiOS集成高德SDK、原生地图,自定义mark重复点击无效

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

作者: archyly | 来源:发表于2018-07-23 10:29 被阅读36次

原因是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重复点击无效

      本文链接:https://www.haomeiwen.com/subject/lppdmftx.html