ios 百度地图修改大头针图片

-(void)mapViewDidFinishLoading:(BMKMapView *)mapView{
    //添加起点,修改大头针图片,代理方法中修改图片
    CLLocationCoordinate2D pLocation = m_pLocationService.userLocation.location.coordinate;
    BMKPointAnnotation* annotation = [[BMKPointAnnotation alloc]init];
    self.delegate = self;
    annotation.coordinate = pLocation;
    [self addAnnotation:annotation];
}

-(BMKAnnotationView *)mapView:(BMKMapView *)mapView viewForAnnotation:(id)annotation{
    BMKAnnotationView *pStarView = [[BMKAnnotationView alloc]initWithFrame:CGRectMake(self.frame.size.width/2, self.frame.size.height/2, 26, 336)];
    UIImageView *pImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 26, 33)];
    [pStarView addSubview:pImage];
    pImage.image = [UIImage imageNamed:@"sport_star"];
    pStarView.backgroundColor = [UIColor clearColor];
    return pStarView;
}
ios 百度地图修改大头针图片_第1张图片
Paste_Image.png

你可能感兴趣的:(ios 百度地图修改大头针图片)