IOS development based on Baidu map (1) -- current user location

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.