qq_24151965 2015-07-16 06:50 采纳率: 0%
浏览 2590

IOS 百度地图 标注删除不了?求求大神啊 拜托了

if (!_perList) {
_perList=[[PersonalViewController alloc]init];
[self becomeFirstResponder];
CGFloat y=CGRectGetMaxY(_toolBar.frame);
CGRect popFrame=CGRectMake(10, y, self.view.frame.size.width-20, self.view.frame.size.height-y-10);
_perList.view.frame=popFrame;
}
__unsafe_unretained PhLocationViewController*mapVC=self;
__unsafe_unretained PersonalViewController *per=_perList;
__block PhLocationViewController *blockSelf = self;
[_perList setSelectedBlock:^(NSString *name,NSString *uid)
{
[AlertHelper MBHUDShow:@"获取中" ForView:blockSelf.view AndDelayHid:30];
[per.view removeFromSuperview];
[phoneLocationWebAPI getUserInMapWithTpe:@"one" uid:uid stime:@"" etime:@"" success:^(NSArray *locList)
{
[mapVC->_mapView removeAnnotations:mapVC->_annoArr];

          if (locList.count==0)
          {
              [AlertHelper hideAllHUDsForView:blockSelf.view];
              [AlertHelper singleMBHUDShow:@"无定位数据" ForView:blockSelf.view AndDelayHid:1.5];
              return ;
          }
          Employee *em1=[[Employee alloc]initWithDic:locList[0]];
          CLLocationCoordinate2D dingweiZhongxin=CLLocationCoordinate2DMake([em1.latitude doubleValue], [em1.longitude doubleValue]);
            [mapVC showMap:CLLocationCoordinate2DMake(dingweiZhongxin.latitude, dingweiZhongxin.longitude) span:BMKCoordinateSpanMake(0.01, 0.01)];;
          for (NSDictionary *dict in locList)
          {
              Employee *em=[[Employee alloc]initWithDic:dict];
              CLGeocoder *geocoder=[[CLGeocoder alloc]init];
              CLLocationCoordinate2D loca2D=CLLocationCoordinate2DMake([em.latitude doubleValue], [em.longitude doubleValue]);

              CLLocation *la=[[CLLocation alloc]initWithLatitude:loca2D.latitude longitude:loca2D.longitude];
              [geocoder reverseGeocodeLocation: la completionHandler:^(NSArray *placemark,NSError *error)
               {
                   CLPlacemark *mark=[placemark objectAtIndex:0];
                   NSString *address = [NSString stringWithFormat:@"%@",mark.name];

                   BMKPointAnnotation *point=[[BMKPointAnnotation alloc]init];
                   point.coordinate=loca2D;
                   point.title=[NSString stringWithFormat:@"%@   状态:%@,%@",em.userName,([@"1" isEqualToString: em.zt  ])?@"在线":@"离线",em.time];
                   point.subtitle=address;
                   [mapVC->_annoArr addObject:point];
                   [mapVC->_mapView addAnnotations:mapVC->_annoArr];
               }];
          }
          [AlertHelper hideAllHUDsForView:blockSelf.view];
      } fail:^(){
          [AlertHelper hideAllHUDsForView:blockSelf.view];
          [AlertHelper singleMBHUDShow:@"网络请求失败" ForView:blockSelf.view AndDelayHid:1.5];
      }];

 }];
[self changeBtnSelected:sender popView:_perList.view];

为啥会出现旧的标注 这样写有什么问题啊

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 八爪鱼爬数据为什么自己停了
    • ¥15 交替优化波束形成和ris反射角使保密速率最大化
    • ¥15 树莓派与pix飞控通信
    • ¥15 自动转发微信群信息到另外一个微信群
    • ¥15 outlook无法配置成功
    • ¥30 这是哪个作者做的宝宝起名网站
    • ¥60 版本过低apk如何修改可以兼容新的安卓系统
    • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
    • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
    • ¥50 有数据,怎么用matlab求全要素生产率