First, you must set the attributes of mapview:
Self. mapview = [[[bmkmapview alloc] initwithframe: cgrectmake (0, 0,100,100)] autorelease]; // We dynamically create a mapview object mapview. showsuserlocation = yes; // The current user location mapview can be displayed. zoomenabled = yes; // zoommapview is allowed. scrollenabled = yes; // allows scrollmapview. maptype = bmkmaptypestandard; // The map type is standard. It can be a satellite, and the traffic mapview can be enabled or disabled. delegate = self; // act as proxy
The method to display the current user location in the center of the map is:
[Mapview setcentercoordinate: mapview. userlocation. Coordinate animated: Yes];
You can set the zoom level of the current map as needed, for example:
[Mapview setzoomlevel: 15];
IOS development based on Baidu map (1) -- current user location
IOS development based on Baidu map (2) -- getting poi
IOS development based on Baidu map (3) -- address search
IOS development based on Baidu map (4) -- path search
IOS development based on Baidu map (5)-Summary of core issues
IOS development based on Baidu map (6) -- Google coordinates to hundreds of coordinates
IOS development based on Baidu map (7) -- convert Baidu coordinates to Google coordinates