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