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 有赏,i卡绘世画不出
    • ¥15 如何用stata画出文献中常见的安慰剂检验图
    • ¥15 c语言链表结构体数据插入
    • ¥40 使用MATLAB解答线性代数问题
    • ¥15 COCOS的问题COCOS的问题
    • ¥15 FPGA-SRIO初始化失败
    • ¥15 MapReduce实现倒排索引失败
    • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
    • ¥15 找一位技术过硬的游戏pj程序员
    • ¥15 matlab生成电测深三层曲线模型代码