iOS Learning Note 29-lbs

Source: Internet
Author: User

Use map kit to create maps and add custom labels

1,mapkit Basic Explanation

2,mkmapview Creating a Map program

3. Position and annotate with a given latitude and longitude

4,mkannotationview Detailed and custom annotations

The map Kit provides an interface to embed maps into your own view

Mkmapview provides a map interface that can be embedded in an application

Mkcoordinateregin Setting the Map display area

Mkpointannotation provides the ability to add comments at a specified point and cannot customize the class

Mkpinannotation This class allows you to set the map callout

Mkannotationview Custom Map Annotations

-(void) Viewdidload {

[Super Viewdidload];

Mkmapview *mkmapview = [[Mkmapview alloc]initwithframe:self.view.frame];

[Self.view Addsubview:mkmapview];

2, map parameter settings

[Mkmapview Setmaptype:mkmaptypestandard];

Magnification mode

[Mkmapview Setzoomenabled:yes];

Prevent the map from sliding left and right

[Mkmapview Setscrollenabled:yes];

Set map rotation

[Mkmapview Setrotateenabled:yes];

Setting the display area

Mkcoordinateregion region = Mkcoordinateregionmake (Cllocationcoordinate2dmake, 119), Mkcoordinatespanmake (0.1, 0.1));

[Mkmapview Setregion:[mkmapview regionthatfits:region];

Additional setup after loading the view, typically from a nib.

}

iOS Learning Note 29-lbs

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.