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 请教:如何用postman调用本地虚拟机区块链接上的合约?
    • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
    • ¥15 乘性高斯噪声在深度学习网络中的应用
    • ¥15 运筹学排序问题中的在线排序
    • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
    • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
    • ¥15 C++ 头文件/宏冲突问题解决
    • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
    • ¥50 安卓adb backup备份子用户应用数据失败
    • ¥20 有人能用聚类分析帮我分析一下文本内容嘛