#pragma mark-bmkmapviewdelegate
Generate the corresponding view according to Anntation
-(Bmkannotationview *) Mapview: (Bmkmapview *) Mapview viewforannotation: (id <BMKAnnotation>) annotation
{
General annotation
NSString *annotationviewid = @ "Clustermark";
Clusterannotation *cluster = (clusterannotation*) annotation;
Clusterannotationview *annotationview = [[Clusterannotationview alloc] Initwithannotation:annotation reuseIdentifier : Annotationviewid];
Annotationview.size = cluster.size;
Annotationview.canshowcallout = no;//will pop up the black box when you click on the PIN.
annotationview.draggable = no;//prohibit labels from dragging on the map
annotationview.annotation = cluster;
Annotationview.image=[uiimage imagewithdata:[nsdata Datawithcontentsofurl:[nsurl URLWithString: Annotation.subtitle]];
Annotationview.centeroffset=cgpointmake (0,0);
UIView *viewforimage=[[uiview alloc]initwithframe:cgrectmake (0, 0, 110, 110)];
Uiimageview *imageview=[[uiimageview alloc]initwithframe:cgrectmake (0, 0, 110, 110)];
[ImageView setimage:[uiimage imagewithdata:[nsdata Datawithcontentsofurl:[nsurl URLWithString:annotation.subtitle] ]]];
Imageview.layer.maskstobounds=yes;
Imageview.layer.cornerRadius = 10;
[Viewforimage Addsubview:imageview];
Annotationview.image=[self Getimagefromview:viewforimage];
return annotationview;
}
-(UIImage *) Getimagefromview: (UIView *) view{
Uigraphicsbeginimagecontext (view.bounds.size);
[View.layer Renderincontext:uigraphicsgetcurrentcontext ()];
UIImage *image = Uigraphicsgetimagefromcurrentimagecontext ();
Uigraphicsendimagecontext ();
return image;
}
View that appears on the left side of the bubble box and can be customized
Annotationview.leftcalloutaccessoryview = [[Uiimageview alloc] initwithimage:[uiimage imagenamed:@ "Icon_ Location.png "];
View customizable on the right side of the bubble box
Annotationview.rightcalloutaccessoryview =selectbutton;
The status of the pop-up bubble box when the callout enters the interface
[Annotationview Setselected:yes Animated:yes];
IOS Settings Baidu Map Custom labeling pictures, custom bubbles